diff options
author | Liam R. Howlett <[email protected]> | 2024-10-31 15:36:08 -0400 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2024-11-11 13:09:42 -0800 |
commit | 8e1817b6ba97c3d92d163447226cf6a0c1f90723 (patch) | |
tree | d056f392ad5e593f537b516f4d404bb1f336a948 /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | 4175eff0e007b3b781f45742551393736346755d (diff) |
vma: detect infinite loop in vma tree
There have been no reported infinite loops in the tree, but checking the
detection of an infinite loop during validation is simple enough. Add the
detection to the validate_mm() function so that error reports are clear
and don't just report stalls.
This does not protect against internal maple tree issues, but it does
detect too many vmas being returned from the tree.
The variance of +10 is to allow for the debugging output to be more useful
for nearly correct counts. In the event of more than 10 over the
map_count, the count will be set to -1 for easier identification of a
potential infinite loop.
Note that the mmap lock is held to ensure a consistent tree state during
the validation process.
[[email protected]: add comment]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Liam R. Howlett <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Reviewed-by: Vlastimil Babka <[email protected]>
Reviewed-by: Lorenzo Stoakes <[email protected]>
Cc: Jann Horn <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions