The patch titled Subject: fs, elf: don't complain MAP_FIXED_NOREPLACE unless -EEXIST error. has been added to the -mm tree. Its filename is fs-elf-dont-complain-map_fixed_noreplace-unless-eexist-error.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/fs-elf-dont-complain-map_fixed_noreplace-unless-eexist-error.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/fs-elf-dont-complain-map_fixed_noreplace-unless-eexist-error.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Subject: fs, elf: don't complain MAP_FIXED_NOREPLACE unless -EEXIST error. 4ed28639519c7bad ("fs, elf: drop MAP_FIXED usage from elf_map") is printing spurious messages under memory pressure due to map_addr == -ENOMEM. 9794 (a.out): Uhuuh, elf segment at 00007f2e34738000(fffffffffffffff4) requested but the memory is mapped already 14104 (a.out): Uhuuh, elf segment at 00007f34fd76c000(fffffffffffffff4) requested but the memory is mapped already 16843 (a.out): Uhuuh, elf segment at 00007f930ecc7000(fffffffffffffff4) requested but the memory is mapped already Complain only if -EEXIST, and use %px for printing the address. Link: http://lkml.kernel.org/r/201804182307.FAC17665.SFMOFJVFtHOLOQ@xxxxxxxxxxxxxxxxxxx Fixes: 4ed28639519c7bad ("fs, elf: drop MAP_FIXED usage from elf_map") is Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxxx> Cc: Andrei Vagin <avagin@xxxxxxxxxx> Cc: Khalid Aziz <khalid.aziz@xxxxxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Abdul Haleem <abdhalee@xxxxxxxxxxxxxxxxxx> Cc: Joel Stanley <joel@xxxxxxxxx> Cc: Anshuman Khandual <khandual@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/binfmt_elf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff -puN fs/binfmt_elf.c~fs-elf-dont-complain-map_fixed_noreplace-unless-eexist-error fs/binfmt_elf.c --- a/fs/binfmt_elf.c~fs-elf-dont-complain-map_fixed_noreplace-unless-eexist-error +++ a/fs/binfmt_elf.c @@ -377,10 +377,10 @@ static unsigned long elf_map(struct file } else map_addr = vm_mmap(filep, addr, size, prot, type, off); - if ((type & MAP_FIXED_NOREPLACE) && BAD_ADDR(map_addr)) - pr_info("%d (%s): Uhuuh, elf segment at %p requested but the memory is mapped already\n", - task_pid_nr(current), current->comm, - (void *)addr); + if ((type & MAP_FIXED_NOREPLACE) && + PTR_ERR((void *)map_addr) == -EEXIST) + pr_info("%d (%s): Uhuuh, elf segment at %px requested but the memory is mapped already\n", + task_pid_nr(current), current->comm, (void *)addr); return(map_addr); } _ Patches currently in -mm which might be from penguin-kernel@xxxxxxxxxxxxxxxxxxx are fs-elf-dont-complain-map_fixed_noreplace-unless-eexist-error.patch dentry-fix-kmemcheck-splat-at-take_dentry_name_snapshot.patch mmvmscan-mark-register_shrinker-as-__must_check.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html