xref: /linux/include/linux/seccomp_types.h (revision 06d07429858317ded2db7986113a9e0129cd599b)
1  /* SPDX-License-Identifier: GPL-2.0 */
2  #ifndef _LINUX_SECCOMP_TYPES_H
3  #define _LINUX_SECCOMP_TYPES_H
4  
5  #include <linux/types.h>
6  
7  #ifdef CONFIG_SECCOMP
8  
9  struct seccomp_filter;
10  /**
11   * struct seccomp - the state of a seccomp'ed process
12   *
13   * @mode:  indicates one of the valid values above for controlled
14   *         system calls available to a process.
15   * @filter_count: number of seccomp filters
16   * @filter: must always point to a valid seccomp-filter or NULL as it is
17   *          accessed without locking during system call entry.
18   *
19   *          @filter must only be accessed from the context of current as there
20   *          is no read locking.
21   */
22  struct seccomp {
23  	int mode;
24  	atomic_t filter_count;
25  	struct seccomp_filter *filter;
26  };
27  
28  #else
29  
30  struct seccomp { };
31  struct seccomp_filter { };
32  
33  #endif
34  
35  #endif /* _LINUX_SECCOMP_TYPES_H */
36