~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/seccomp.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _LINUX_SECCOMP_H
  3 #define _LINUX_SECCOMP_H
  4 
  5 #include <uapi/linux/seccomp.h>
  6 #include <linux/seccomp_types.h>
  7 
  8 #define SECCOMP_FILTER_FLAG_MASK        (SECCOMP_FILTER_FLAG_TSYNC | \
  9                                          SECCOMP_FILTER_FLAG_LOG | \
 10                                          SECCOMP_FILTER_FLAG_SPEC_ALLOW | \
 11                                          SECCOMP_FILTER_FLAG_NEW_LISTENER | \
 12                                          SECCOMP_FILTER_FLAG_TSYNC_ESRCH | \
 13                                          SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV)
 14 
 15 /* sizeof() the first published struct seccomp_notif_addfd */
 16 #define SECCOMP_NOTIFY_ADDFD_SIZE_VER0 24
 17 #define SECCOMP_NOTIFY_ADDFD_SIZE_LATEST SECCOMP_NOTIFY_ADDFD_SIZE_VER0
 18 
 19 #ifdef CONFIG_SECCOMP
 20 
 21 #include <linux/thread_info.h>
 22 #include <linux/atomic.h>
 23 #include <asm/seccomp.h>
 24 
 25 #ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
 26 extern int __secure_computing(const struct seccomp_data *sd);
 27 static inline int secure_computing(void)
 28 {
 29         if (unlikely(test_syscall_work(SECCOMP)))
 30                 return  __secure_computing(NULL);
 31         return 0;
 32 }
 33 #else
 34 extern void secure_computing_strict(int this_syscall);
 35 #endif
 36 
 37 extern long prctl_get_seccomp(void);
 38 extern long prctl_set_seccomp(unsigned long, void __user *);
 39 
 40 static inline int seccomp_mode(struct seccomp *s)
 41 {
 42         return s->mode;
 43 }
 44 
 45 #else /* CONFIG_SECCOMP */
 46 
 47 #include <linux/errno.h>
 48 
 49 struct seccomp_data;
 50 
 51 #ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
 52 static inline int secure_computing(void) { return 0; }
 53 static inline int __secure_computing(const struct seccomp_data *sd) { return 0; }
 54 #else
 55 static inline void secure_computing_strict(int this_syscall) { return; }
 56 #endif
 57 
 58 static inline long prctl_get_seccomp(void)
 59 {
 60         return -EINVAL;
 61 }
 62 
 63 static inline long prctl_set_seccomp(unsigned long arg2, char __user *arg3)
 64 {
 65         return -EINVAL;
 66 }
 67 
 68 static inline int seccomp_mode(struct seccomp *s)
 69 {
 70         return SECCOMP_MODE_DISABLED;
 71 }
 72 #endif /* CONFIG_SECCOMP */
 73 
 74 #ifdef CONFIG_SECCOMP_FILTER
 75 extern void seccomp_filter_release(struct task_struct *tsk);
 76 extern void get_seccomp_filter(struct task_struct *tsk);
 77 #else  /* CONFIG_SECCOMP_FILTER */
 78 static inline void seccomp_filter_release(struct task_struct *tsk)
 79 {
 80         return;
 81 }
 82 static inline void get_seccomp_filter(struct task_struct *tsk)
 83 {
 84         return;
 85 }
 86 #endif /* CONFIG_SECCOMP_FILTER */
 87 
 88 #if defined(CONFIG_SECCOMP_FILTER) && defined(CONFIG_CHECKPOINT_RESTORE)
 89 extern long seccomp_get_filter(struct task_struct *task,
 90                                unsigned long filter_off, void __user *data);
 91 extern long seccomp_get_metadata(struct task_struct *task,
 92                                  unsigned long filter_off, void __user *data);
 93 #else
 94 static inline long seccomp_get_filter(struct task_struct *task,
 95                                       unsigned long n, void __user *data)
 96 {
 97         return -EINVAL;
 98 }
 99 static inline long seccomp_get_metadata(struct task_struct *task,
100                                         unsigned long filter_off,
101                                         void __user *data)
102 {
103         return -EINVAL;
104 }
105 #endif /* CONFIG_SECCOMP_FILTER && CONFIG_CHECKPOINT_RESTORE */
106 
107 #ifdef CONFIG_SECCOMP_CACHE_DEBUG
108 struct seq_file;
109 struct pid_namespace;
110 struct pid;
111 
112 int proc_pid_seccomp_cache(struct seq_file *m, struct pid_namespace *ns,
113                            struct pid *pid, struct task_struct *task);
114 #endif
115 #endif /* _LINUX_SECCOMP_H */
116 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php