[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200219185330.GA4933@avx2>
Date: Wed, 19 Feb 2020 21:53:30 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] ELF: 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.
Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---
fs/binfmt_elf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1075,6 +1075,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
fput(interpreter);
kfree(interp_elf_ex);
+ kfree(interp_elf_phdata);
} else {
elf_entry = e_entry;
if (BAD_ADDR(elf_entry)) {
@@ -1083,7 +1084,6 @@ static int load_elf_binary(struct linux_binprm *bprm)
}
}
- kfree(interp_elf_phdata);
kfree(elf_phdata);
set_binfmt(&elf_format);
Powered by blists - more mailing lists