Skip to content
Snippets Groups Projects
Commit eb7d521d authored by Peilin Ye's avatar Peilin Ye Committed by Andreas Gnau
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarPeilin Ye <yepeilin.cs@gmail.com>
Reviewed-by: default avatarDmitry 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: default avatarChristian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: default avatarPiotr Kubik <piotr.kubik@iopsys.eu>
parent cefd543d
Branches bcm_5.04L.04p3
No related tags found
1 merge request!6ptrace: add PTRACE_GET_SYSCALL_INFO request
...@@ -81,7 +81,8 @@ struct seccomp_metadata { ...@@ -81,7 +81,8 @@ struct seccomp_metadata {
struct ptrace_syscall_info { struct ptrace_syscall_info {
__u8 op; /* PTRACE_SYSCALL_INFO_* */ __u8 op; /* PTRACE_SYSCALL_INFO_* */
__u32 arch __attribute__((__aligned__(sizeof(__u32)))); __u8 pad[3];
__u32 arch;
__u64 instruction_pointer; __u64 instruction_pointer;
__u64 stack_pointer; __u64 stack_pointer;
union { union {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment