diff options
| author | SJ Park <sj@kernel.org> | 2026-07-10 06:46:36 -0700 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-08-04 19:18:50 -0700 |
| commit | e1f150d41516c192e3b78f360a7fb2dd9879abda (patch) | |
| tree | 36526c69c45cdfeca044e11cb9387901a882894b /tools/perf/scripts/python | |
| parent | 3858025f48cf764c3c653b311a1fa1b2eb720a5c (diff) | |
mm/damon/core: use abs_diff() instead of abs()
Use of abs() in damon_merge_regions_of() could cause a silent integer
overflow since the macro casts unsigned int to signed int. It is unlikely
to have such a large value for nr_accesses. Even though it happens, the
user impact is just degraded monitoring results. Users showing bad
monitoring results for weird setup is quite trivial. But the code is
obviously wrong. Use abs_diff() instead.
The issue was discovered [1] by Sashiko.
Link: https://lore.kernel.org/20260710134651.18084-8-sj@kernel.org
Link: https://lore.kernel.org/20260705213817.100841-1-sj@kernel.org/ [1]
Signed-off-by: SJ Park <sj@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
