The patch titled Subject: fs/binfmt_elf.c: make BAD_ADDR() unlikely has been added to the -mm tree. Its filename is elf-make-bad_addr-unlikely.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/elf-make-bad_addr-unlikely.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/elf-make-bad_addr-unlikely.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: Alexey Dobriyan <adobriyan@xxxxxxxxx> Subject: fs/binfmt_elf.c: make BAD_ADDR() unlikely If some mapping goes past TASK_SIZE it will be rejected by kernel which means no such userspace binaries exist. Mark every such check as unlikely. Link: http://lkml.kernel.org/r/20191215124355.GA21124@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/binfmt_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/binfmt_elf.c~elf-make-bad_addr-unlikely +++ a/fs/binfmt_elf.c @@ -97,7 +97,7 @@ static struct linux_binfmt elf_format = .min_coredump = ELF_EXEC_PAGESIZE, }; -#define BAD_ADDR(x) ((unsigned long)(x) >= TASK_SIZE) +#define BAD_ADDR(x) (unlikely((unsigned long)(x) >= TASK_SIZE)) static int set_brk(unsigned long start, unsigned long end, int prot) { _ Patches currently in -mm which might be from adobriyan@xxxxxxxxx are ramfs-support-o_tmpfile.patch elf-smaller-code-generation-around-auxv-vector-fill.patch elf-fix-start_code-calculation.patch elf-dont-copy-elf-header-around.patch elf-better-codegen-around-current-mm.patch elf-make-bad_addr-unlikely.patch execve-warn-if-process-starts-with-executable-stack.patch