Skip to content

Commit dee17d0

Browse files
committed
system: use notification structs from include/seccomp.h
We don't want to duplicate struct definitions unless absolutely necessary. Acked-by: Tom Hromatka <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent e7e633c commit dee17d0

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

src/system.h

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,30 +156,16 @@ typedef struct sock_filter bpf_instr_raw;
156156
#define SECCOMP_RET_LOG 0x7fc00000U
157157
#endif
158158

159-
/* SECCOMP_RET_USER_NOTIF was added in kernel v5.0. */
160-
#ifndef SECCOMP_RET_USER_NOTIF
161-
#define SECCOMP_RET_USER_NOTIF 0x7fc00000U
159+
/* seccomp user notifications were added in kernel v5.0. */
160+
#ifndef SECCOMP_IOCTL_NOTIF_ID_VALID
162161

162+
/* NOTE: seccomp_{notif, notif_resp} structs are in include/seccomp.h */
163163
struct seccomp_notif_sizes {
164164
__u16 seccomp_notif;
165165
__u16 seccomp_notif_resp;
166166
__u16 seccomp_data;
167167
};
168168

169-
struct seccomp_notif {
170-
__u64 id;
171-
__u32 pid;
172-
__u32 flags;
173-
struct seccomp_data data;
174-
};
175-
176-
struct seccomp_notif_resp {
177-
__u64 id;
178-
__s64 val;
179-
__s32 error;
180-
__u32 flags;
181-
};
182-
183169
#define SECCOMP_IOC_MAGIC '!'
184170
#define SECCOMP_IO(nr) _IO(SECCOMP_IOC_MAGIC, nr)
185171
#define SECCOMP_IOR(nr, type) _IOR(SECCOMP_IOC_MAGIC, nr, type)
@@ -191,7 +177,8 @@ struct seccomp_notif_resp {
191177
#define SECCOMP_IOCTL_NOTIF_SEND SECCOMP_IOWR(1, \
192178
struct seccomp_notif_resp)
193179
#define SECCOMP_IOCTL_NOTIF_ID_VALID SECCOMP_IOW(2, __u64)
194-
#endif /* SECCOMP_RET_USER_NOTIF */
180+
181+
#endif /* SECCOMP_IOCTL_NOTIF_ID_VALID */
195182

196183
/* non-public ioctl number for backwards compat (see system.c) */
197184
#define SECCOMP_IOCTL_NOTIF_ID_VALID_WRONG_DIR SECCOMP_IOR(2, __u64)

0 commit comments

Comments
 (0)