diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2018-01-22 21:58:57 +0100 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2018-01-23 02:07:08 +0100 |
commit | 5f74972ce69fdc6473f74253283408af75a3be15 (patch) | |
tree | 0353784ed4e95a7a32e159ba9b66d1f697317680 /arch/arc | |
parent | signal/arm64: Better isolate the COMPAT_TASK portion of ptrace_hbptriggered (diff) | |
download | linux-5f74972ce69fdc6473f74253283408af75a3be15.tar.xz linux-5f74972ce69fdc6473f74253283408af75a3be15.zip |
signal: Don't use structure initializers for struct siginfo
The siginfo structure has all manners of holes with the result that a
structure initializer is not guaranteed to initialize all of the bits.
As we have to copy the structure to userspace don't even try to use
a structure initializer. Instead use clear_siginfo followed by initializing
selected fields. This gives a guarantee that uninitialized kernel memory
is not copied to userspace.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/kernel/traps.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/arc/kernel/traps.c b/arch/arc/kernel/traps.c index bcd7c9fc5d0f..c7206789e9ce 100644 --- a/arch/arc/kernel/traps.c +++ b/arch/arc/kernel/traps.c @@ -65,12 +65,14 @@ unhandled_exception(const char *str, struct pt_regs *regs, siginfo_t *info) #define DO_ERROR_INFO(signr, str, name, sicode) \ int name(unsigned long address, struct pt_regs *regs) \ { \ - siginfo_t info = { \ - .si_signo = signr, \ - .si_errno = 0, \ - .si_code = sicode, \ - .si_addr = (void __user *)address, \ - }; \ + siginfo_t info; \ + \ + clear_siginfo(&info); \ + info.si_signo = signr; \ + info.si_errno = 0; \ + info.si_code = sicode; \ + info.si_addr = (void __user *)address; \ + \ return unhandled_exception(str, regs, &info);\ } |