mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 23:04:54 +01:00
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]>