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/arm64/kernel/ptrace.c | |
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/arm64/kernel/ptrace.c')
-rw-r--r-- | arch/arm64/kernel/ptrace.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 0a1cf830e4b3..95daa1478a7c 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -180,12 +180,13 @@ static void ptrace_hbptriggered(struct perf_event *bp, struct pt_regs *regs) { struct arch_hw_breakpoint *bkpt = counter_arch_bp(bp); - siginfo_t info = { - .si_signo = SIGTRAP, - .si_errno = 0, - .si_code = TRAP_HWBKPT, - .si_addr = (void __user *)(bkpt->trigger), - }; + siginfo_t info; + + clear_siginfo(&info); + info.si_signo = SIGTRAP; + info.si_errno = 0; + info.si_code = TRAP_HWBKPT; + info.si_addr = (void __user *)(bkpt->trigger); #ifdef CONFIG_COMPAT if (is_compat_task()) { |