提交 e9878970 编写于 作者: P Peilin Ye 提交者: Chen Jun

ptrace: Prevent kernel-infoleak in ptrace_get_syscall_info()

stable inclusion
from stable-5.10.2
commit d3f4117b0275b2fb2de3a034fe1060a80104833f
bugzilla: 46859

--------------------------------

commit 0032ce0f 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: 201766a2 ("ptrace: add PTRACE_GET_SYSCALL_INFO request")
Suggested-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NPeilin Ye <yepeilin.cs@gmail.com>
Reviewed-by: NDmitry V. Levin <ldv@altlinux.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200801152044.230416-1-yepeilin.cs@gmail.comSigned-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
上级 b9a90a6e
......@@ -81,7 +81,8 @@ struct seccomp_metadata {
struct ptrace_syscall_info {
__u8 op; /* PTRACE_SYSCALL_INFO_* */
__u32 arch __attribute__((__aligned__(sizeof(__u32))));
__u8 pad[3];
__u32 arch;
__u64 instruction_pointer;
__u64 stack_pointer;
union {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册