author: Alexey Dobriyan <adobriyan@gmail.com> 2019-05-14 15:43:54 -0700
committer: Linus Torvalds <torvalds@linux-foundation.org> 2019-05-14 19:52:50 -0700
commit: 249b08e4e504d4c54eda3453c9c97edbafa51401
parent: d8e7cb39acc66316106ef8bda9b76f9f3cbbcad0
Commit Summary:
Diffstat:
1 file changed, 2 insertions, 1 deletion
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 31f264bd5126..1a66b6215c80 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -704,12 +704,12 @@ static int load_elf_binary(struct linux_binprm *bprm)
unsigned long start_code, end_code, start_data, end_data;
unsigned long reloc_func_desc __maybe_unused = 0;
int executable_stack = EXSTACK_DEFAULT;
- struct pt_regs *regs = current_pt_regs();
struct {
struct elfhdr elf_ex;
struct elfhdr interp_elf_ex;
} *loc;
struct arch_elf_state arch_state = INIT_ARCH_ELF_STATE;
+ struct pt_regs *regs;
loc = kmalloc(sizeof(*loc), GFP_KERNEL);
if (!loc) {
@@ -1150,6 +1150,7 @@ out_free_interp:
MAP_FIXED | MAP_PRIVATE, 0);
}
+ regs = current_pt_regs();
#ifdef ELF_PLAT_INIT
/*
* The ABI may specify that certain registers be set up in special