Release 4.16 include/linux/seccomp.h
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_SECCOMP_H
#define _LINUX_SECCOMP_H
#include <uapi/linux/seccomp.h>
#define SECCOMP_FILTER_FLAG_MASK (SECCOMP_FILTER_FLAG_TSYNC | \
SECCOMP_FILTER_FLAG_LOG)
#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
Person | Tokens | Prop | Commits | CommitProp |
Andrea Arcangeli | 18 | 56.25% | 1 | 33.33% |
Andrew Lutomirski | 8 | 25.00% | 1 | 33.33% |
Will Drewry | 6 | 18.75% | 1 | 33.33% |
Total | 32 | 100.00% | 3 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Andrew Lutomirski | 15 | 88.24% | 1 | 50.00% |
Will Drewry | 2 | 11.76% | 1 | 50.00% |
Total | 17 | 100.00% | 2 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Stephen Rothwell | 8 | 53.33% | 1 | 33.33% |
Andrew Lutomirski | 4 | 26.67% | 1 | 33.33% |
Andrea Arcangeli | 3 | 20.00% | 1 | 33.33% |
Total | 15 | 100.00% | 3 | 100.00% |
#else
static inline void secure_computing_strict(int this_syscall) { return; }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Will Drewry | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
#endif
static inline long prctl_get_seccomp(void)
{
return -EINVAL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Andrea Arcangeli | 13 | 100.00% | 1 | 100.00% |
Total | 13 | 100.00% | 1 | 100.00% |
static inline long prctl_set_seccomp(unsigned long arg2, char __user *arg3)
{
return -EINVAL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Andrea Arcangeli | 15 | 75.00% | 1 | 50.00% |
Will Drewry | 5 | 25.00% | 1 | 50.00% |
Total | 20 | 100.00% | 2 | 100.00% |
static inline int seccomp_mode(struct seccomp *s)
{
return SECCOMP_MODE_DISABLED;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Andrew Lutomirski | 12 | 80.00% | 1 | 33.33% |
Will Drewry | 2 | 13.33% | 1 | 33.33% |
Kees Cook | 1 | 6.67% | 1 | 33.33% |
Total | 15 | 100.00% | 3 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Will Drewry | 13 | 100.00% | 1 | 100.00% |
Total | 13 | 100.00% | 1 | 100.00% |
static inline void get_seccomp_filter(struct task_struct *tsk)
{
return;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Will Drewry | 13 | 100.00% | 1 | 100.00% |
Total | 13 | 100.00% | 1 | 100.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);
extern long seccomp_get_metadata(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
Person | Tokens | Prop | Commits | CommitProp |
Tycho Andersen | 25 | 100.00% | 1 | 100.00% |
Total | 25 | 100.00% | 1 | 100.00% |
static inline long seccomp_get_metadata(struct task_struct *task,
unsigned long filter_off,
void __user *data)
{
return -EINVAL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Tycho Andersen | 25 | 100.00% | 1 | 100.00% |
Total | 25 | 100.00% | 1 | 100.00% |
#endif /* CONFIG_SECCOMP_FILTER && CONFIG_CHECKPOINT_RESTORE */
#endif /* _LINUX_SECCOMP_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Will Drewry | 112 | 28.43% | 4 | 20.00% |
Tycho Andersen | 104 | 26.40% | 2 | 10.00% |
Andrea Arcangeli | 99 | 25.13% | 3 | 15.00% |
Andrew Lutomirski | 60 | 15.23% | 3 | 15.00% |
Stephen Rothwell | 8 | 2.03% | 1 | 5.00% |
Kees Cook | 5 | 1.27% | 3 | 15.00% |
Ralf Bächle | 3 | 0.76% | 1 | 5.00% |
Tyler Hicks | 1 | 0.25% | 1 | 5.00% |
Greg Kroah-Hartman | 1 | 0.25% | 1 | 5.00% |
David Howells | 1 | 0.25% | 1 | 5.00% |
Total | 394 | 100.00% | 20 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.