The patch titled Subject: fs/binfmt_elf.c: don't free interpreter's ELF pheaders on common path has been added to the -mm tree. Its filename is elf-dont-free-interpreters-elf-pheaders-on-common-path.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/elf-dont-free-interpreters-elf-pheaders-on-common-path.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/elf-dont-free-interpreters-elf-pheaders-on-common-path.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: don't free interpreter's ELF pheaders on common path Static executables don't need to free NULL pointer. It doesn't matter really because static executable is not common scenario but do it anyway out of pedantry. Link: http://lkml.kernel.org/r/20200219185330.GA4933@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx> 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-dont-free-interpreters-elf-pheaders-on-common-path +++ a/fs/binfmt_elf.c @@ -1075,6 +1075,7 @@ out_free_interp: fput(interpreter); kfree(interp_elf_ex); + kfree(interp_elf_phdata); } else { elf_entry = e_entry; if (BAD_ADDR(elf_entry)) { @@ -1083,7 +1084,6 @@ out_free_interp: } } - kfree(interp_elf_phdata); kfree(elf_phdata); set_binfmt(&elf_format); _ Patches currently in -mm which might be from adobriyan@xxxxxxxxx are ramfs-support-o_tmpfile.patch elf-delete-loc-variable.patch elf-allocate-less-for-static-executable.patch elf-dont-free-interpreters-elf-pheaders-on-common-path.patch