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:30:06 +0000 (13:30 +0100)
commitd3f4117b0275b2fb2de3a034fe1060a80104833f
tree1d7337ab8220790b871a179a0ad2ff1104f10a0b
parent841fca5a32cccd7d0123c0271f4350161ada5507
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