Skip to content

Commit

Permalink
seccomp, ptrace: switch get_metadata types to arch independent
Browse files Browse the repository at this point in the history
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" <[email protected]>
Signed-off-by: Tycho Andersen <[email protected]>
CC: Kees Cook <[email protected]>
CC: Oleg Nesterov <[email protected]>
Reviewed-by: "Dmitry V. Levin" <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
tych0 authored and kees committed Feb 22, 2018
1 parent 2650047 commit 2a040f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/uapi/linux/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ struct ptrace_peeksiginfo_args {
#define PTRACE_SECCOMP_GET_METADATA 0x420d

struct seccomp_metadata {
unsigned long filter_off; /* Input: which filter */
unsigned int flags; /* Output: filter's flags */
__u64 filter_off; /* Input: which filter */
__u64 flags; /* Output: filter's flags */
};

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

0 comments on commit 2a040f9

Please sign in to comment.