Skip to content

Commit 2a040f9

Browse files
tych0kees
authored andcommitted
seccomp, ptrace: switch get_metadata types to arch independent
Commit 2650047 ("ptrace, seccomp: add support for retrieving seccomp metadata") introduced `struct seccomp_metadata`, which contained unsigned longs that should be arch independent. The type of the flags member was chosen to match the corresponding argument to seccomp(), and so we need something at least as big as unsigned long. My understanding is that __u64 should fit the bill, so let's switch both types to that. While this is userspace facing, it was only introduced in 4.16-rc2, and so should be safe assuming it goes in before then. Reported-by: "Dmitry V. Levin" <ldv@altlinux.org> Signed-off-by: Tycho Andersen <tycho@tycho.ws> CC: Kees Cook <keescook@chromium.org> CC: Oleg Nesterov <oleg@redhat.com> Reviewed-by: "Dmitry V. Levin" <ldv@altlinux.org> Signed-off-by: Kees Cook <keescook@chromium.org>
1 parent 2650047 commit 2a040f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/uapi/linux/ptrace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ struct ptrace_peeksiginfo_args {
6969
#define PTRACE_SECCOMP_GET_METADATA 0x420d
7070

7171
struct seccomp_metadata {
72-
unsigned long filter_off; /* Input: which filter */
73-
unsigned int flags; /* Output: filter's flags */
72+
__u64 filter_off; /* Input: which filter */
73+
__u64 flags; /* Output: filter's flags */
7474
};
7575

7676
/* Read signals from a shared (process wide) queue */

0 commit comments

Comments
 (0)