ptrace: Prevent kernel-infoleak in ptrace_get_syscall_info()
authorPeilin Ye <yepeilin.cs@gmail.com>
Sat, 1 Aug 2020 15:20:44 +0000 (11:20 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2020 12:28:14 +0000 (13:28 +0100)
commitc40eb4362c0820b233f6750edb094ad0c5858f56
tree2c46d1e969231f0c1b3ef23422bf2007d32d25e4
parent8df7025920ebbbd8b523fc052e28cc65acb44591
ptrace: Prevent kernel-infoleak in ptrace_get_syscall_info()

commit 0032ce0f85a269a006e91277be5fdbc05fad8426 upstream.

ptrace_get_syscall_info() is potentially copying uninitialized stack
memory to userspace, since the compiler may leave a 3-byte hole near the
beginning of `info`. Fix it by adding a padding field to `struct
ptrace_syscall_info`.

Fixes: 201766a20e30 ("ptrace: add PTRACE_GET_SYSCALL_INFO request")
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200801152044.230416-1-yepeilin.cs@gmail.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/uapi/linux/ptrace.h