cregit-Linux how code gets into the kernel

Release 4.12 include/linux/seccomp.h

Directory: include/linux
#ifndef _LINUX_SECCOMP_H

#define _LINUX_SECCOMP_H

#include <uapi/linux/seccomp.h>


#define SECCOMP_FILTER_FLAG_MASK	(SECCOMP_FILTER_FLAG_TSYNC)

#ifdef CONFIG_SECCOMP

#include <linux/thread_info.h>
#include <asm/seccomp.h>

struct seccomp_filter;
/**
 * struct seccomp - the state of a seccomp'ed process
 *
 * @mode:  indicates one of the valid values above for controlled
 *         system calls available to a process.
 * @filter: must always point to a valid seccomp-filter or NULL as it is
 *          accessed without locking during system call entry.
 *
 *          @filter must only be accessed from the context of current as there
 *          is no read locking.
 */

struct seccomp {
	
int mode;
	
struct seccomp_filter *filter;
};

#ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
extern int __secure_computing(const struct seccomp_data *sd);

static inline int secure_computing(const struct seccomp_data *sd) { if (unlikely(test_thread_flag(TIF_SECCOMP))) return __secure_computing(sd); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli1856.25%133.33%
Andrew Lutomirski825.00%133.33%
Will Drewry618.75%133.33%
Total32100.00%3100.00%

#else extern void secure_computing_strict(int this_syscall); #endif extern long prctl_get_seccomp(void); extern long prctl_set_seccomp(unsigned long, char __user *);
static inline int seccomp_mode(struct seccomp *s) { return s->mode; }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Lutomirski1588.24%150.00%
Will Drewry211.76%150.00%
Total17100.00%2100.00%

#else /* CONFIG_SECCOMP */ #include <linux/errno.h> struct seccomp { }; struct seccomp_filter { }; #ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
static inline int secure_computing(struct seccomp_data *sd) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Stephen Rothwell853.33%133.33%
Andrew Lutomirski426.67%133.33%
Andrea Arcangeli320.00%133.33%
Total15100.00%3100.00%

#else
static inline void secure_computing_strict(int this_syscall) { return; }

Contributors

PersonTokensPropCommitsCommitProp
Will Drewry11100.00%1100.00%
Total11100.00%1100.00%

#endif
static inline long prctl_get_seccomp(void) { return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli13100.00%1100.00%
Total13100.00%1100.00%


static inline long prctl_set_seccomp(unsigned long arg2, char __user *arg3) { return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli1575.00%150.00%
Will Drewry525.00%150.00%
Total20100.00%2100.00%


static inline int seccomp_mode(struct seccomp *s) { return SECCOMP_MODE_DISABLED; }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Lutomirski1280.00%133.33%
Will Drewry213.33%133.33%
Kees Cook16.67%133.33%
Total15100.00%3100.00%

#endif /* CONFIG_SECCOMP */ #ifdef CONFIG_SECCOMP_FILTER extern void put_seccomp_filter(struct task_struct *tsk); extern void get_seccomp_filter(struct task_struct *tsk); #else /* CONFIG_SECCOMP_FILTER */
static inline void put_seccomp_filter(struct task_struct *tsk) { return; }

Contributors

PersonTokensPropCommitsCommitProp
Will Drewry13100.00%1100.00%
Total13100.00%1100.00%


static inline void get_seccomp_filter(struct task_struct *tsk) { return; }

Contributors

PersonTokensPropCommitsCommitProp
Will Drewry13100.00%1100.00%
Total13100.00%1100.00%

#endif /* CONFIG_SECCOMP_FILTER */ #if defined(CONFIG_SECCOMP_FILTER) && defined(CONFIG_CHECKPOINT_RESTORE) extern long seccomp_get_filter(struct task_struct *task, unsigned long filter_off, void __user *data); #else
static inline long seccomp_get_filter(struct task_struct *task, unsigned long n, void __user *data) { return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
Tycho Andersen25100.00%1100.00%
Total25100.00%1100.00%

#endif /* CONFIG_SECCOMP_FILTER && CONFIG_CHECKPOINT_RESTORE */ #endif /* _LINUX_SECCOMP_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Will Drewry11232.09%423.53%
Andrea Arcangeli9928.37%317.65%
Tycho Andersen6017.19%15.88%
Andrew Lutomirski6017.19%317.65%
Stephen Rothwell82.29%15.88%
Kees Cook61.72%317.65%
Ralf Bächle30.86%15.88%
David Howells10.29%15.88%
Total349100.00%17100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.