Files
erofs-linux/tools/testing/selftests/perf_events
Hongfu Li 2f5026b8d4 selftests/perf_events: fix mmap() error check in sigtrap_threads
In sigtrap_threads(), the return value of mmap() is checked against NULL. 
mmap() returns MAP_FAILED, which is (void *)-1, not NULL, when it fails. 
Since MAP_FAILED is non-zero and non-NULL, the condition "p == NULL" will
never be true on failure, causing the program to proceed with an invalid
pointer and segfault if mmap() actually fails under memory pressure.

Link: https://lore.kernel.org/[email protected]
Signed-off-by: Hongfu Li <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Mickael Salaun <[email protected]>
Cc: SeongJae Park <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Wei Yang <[email protected]>
Cc: Kyle Huey <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2026-05-28 21:24:49 -07:00
..
…
…
…