aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/debug-monitors.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-01-22 14:58:57 -0600
committerEric W. Biederman <ebiederm@xmission.com>2018-01-22 19:07:08 -0600
commit5f74972ce69fdc6473f74253283408af75a3be15 (patch)
tree0353784ed4e95a7a32e159ba9b66d1f697317680 /arch/arm64/kernel/debug-monitors.c
parentsignal/arm64: Better isolate the COMPAT_TASK portion of ptrace_hbptriggered (diff)
downloadlinux-dev-5f74972ce69fdc6473f74253283408af75a3be15.tar.xz
linux-dev-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/debug-monitors.c')
-rw-r--r--arch/arm64/kernel/debug-monitors.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index a88b6ccebbb4..53781f5687c5 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -209,12 +209,13 @@ NOKPROBE_SYMBOL(call_step_hook);
static void send_user_sigtrap(int si_code)
{
struct pt_regs *regs = current_pt_regs();
- siginfo_t info = {
- .si_signo = SIGTRAP,
- .si_errno = 0,
- .si_code = si_code,
- .si_addr = (void __user *)instruction_pointer(regs),
- };
+ siginfo_t info;
+
+ clear_siginfo(&info);
+ info.si_signo = SIGTRAP;
+ info.si_errno = 0;
+ info.si_code = si_code;
+ info.si_addr = (void __user *)instruction_pointer(regs);
if (WARN_ON(!user_mode(regs)))
return;