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)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 18 Aug 2020 11:39:23 +0000 (13:39 +0200)
commit0032ce0f85a269a006e91277be5fdbc05fad8426
treeff4a55f4f23411fbe8bae722659b24d2f5febf50
parent9123e3a74ec7b934a4a099e98af6a61c2f80bbf5
ptrace: Prevent kernel-infoleak in ptrace_get_syscall_info()

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>
include/uapi/linux/ptrace.h