#include <linux/export.h>
#include <linux/mm.h>
#include <linux/mm_inline.h>
#include <linux/utsname.h>
#include <linux/mman.h>
#include <linux/reboot.h>
#include <linux/prctl.h>
#include <linux/highuid.h>
#include <linux/fs.h>
#include <linux/kmod.h>
#include <linux/ksm.h>
#include <linux/perf_event.h>
#include <linux/resource.h>
#include <linux/kernel.h>
#include <linux/workqueue.h>
#include <linux/capability.h>
#include <linux/device.h>
#include <linux/key.h>
#include <linux/times.h>
#include <linux/posix-timers.h>
#include <linux/security.h>
#include <linux/random.h>
#include <linux/suspend.h>
#include <linux/tty.h>
#include <linux/signal.h>
#include <linux/cn_proc.h>
#include <linux/getcpu.h>
#include <linux/task_io_accounting_ops.h>
#include <linux/seccomp.h>
#include <linux/cpu.h>
#include <linux/personality.h>
#include <linux/ptrace.h>
#include <linux/fs_struct.h>
#include <linux/file.h>
#include <linux/mount.h>
#include <linux/gfp.h>
#include <linux/syscore_ops.h>
#include <linux/version.h>
#include <linux/ctype.h>
#include <linux/syscall_user_dispatch.h>
#include <linux/compat.h>
#include <linux/syscalls.h>
#include <linux/kprobes.h>
#include <linux/user_namespace.h>
#include <linux/time_namespace.h>
#include <linux/binfmts.h>
#include <linux/sched.h>
#include <linux/sched/autogroup.h>
#include <linux/sched/loadavg.h>
#include <linux/sched/stat.h>
#include <linux/sched/mm.h>
#include <linux/sched/coredump.h>
#include <linux/sched/task.h>
#include <linux/sched/cputime.h>
#include <linux/rcupdate.h>
#include <linux/uidgid.h>
#include <linux/cred.h>
#include <linux/nospec.h>
#include <linux/kmsg_dump.h>
#include <generated/utsrelease.h>
#include <linux/uaccess.h>
#include <asm/io.h>
#include <asm/unistd.h>
#include "uid16.h"
#ifndef SET_UNALIGN_CTL
#define SET_UNALIGN_CTL(a, b) …
#endif
#ifndef GET_UNALIGN_CTL
#define GET_UNALIGN_CTL(a, b) …
#endif
#ifndef SET_FPEMU_CTL
#define SET_FPEMU_CTL(a, b) …
#endif
#ifndef GET_FPEMU_CTL
#define GET_FPEMU_CTL(a, b) …
#endif
#ifndef SET_FPEXC_CTL
#define SET_FPEXC_CTL(a, b) …
#endif
#ifndef GET_FPEXC_CTL
#define GET_FPEXC_CTL(a, b) …
#endif
#ifndef GET_ENDIAN
#define GET_ENDIAN(a, b) …
#endif
#ifndef SET_ENDIAN
#define SET_ENDIAN(a, b) …
#endif
#ifndef GET_TSC_CTL
#define GET_TSC_CTL …
#endif
#ifndef SET_TSC_CTL
#define SET_TSC_CTL …
#endif
#ifndef GET_FP_MODE
#define GET_FP_MODE(a) …
#endif
#ifndef SET_FP_MODE
#define SET_FP_MODE(a,b) …
#endif
#ifndef SVE_SET_VL
#define SVE_SET_VL(a) …
#endif
#ifndef SVE_GET_VL
#define SVE_GET_VL() …
#endif
#ifndef SME_SET_VL
#define SME_SET_VL(a) …
#endif
#ifndef SME_GET_VL
#define SME_GET_VL() …
#endif
#ifndef PAC_RESET_KEYS
#define PAC_RESET_KEYS(a, b) …
#endif
#ifndef PAC_SET_ENABLED_KEYS
#define PAC_SET_ENABLED_KEYS(a, b, c) …
#endif
#ifndef PAC_GET_ENABLED_KEYS
#define PAC_GET_ENABLED_KEYS(a) …
#endif
#ifndef SET_TAGGED_ADDR_CTRL
#define SET_TAGGED_ADDR_CTRL(a) …
#endif
#ifndef GET_TAGGED_ADDR_CTRL
#define GET_TAGGED_ADDR_CTRL() …
#endif
#ifndef RISCV_V_SET_CONTROL
#define RISCV_V_SET_CONTROL(a) …
#endif
#ifndef RISCV_V_GET_CONTROL
#define RISCV_V_GET_CONTROL() …
#endif
#ifndef RISCV_SET_ICACHE_FLUSH_CTX
#define RISCV_SET_ICACHE_FLUSH_CTX(a, b) …
#endif
#ifndef PPC_GET_DEXCR_ASPECT
#define PPC_GET_DEXCR_ASPECT(a, b) …
#endif
#ifndef PPC_SET_DEXCR_ASPECT
#define PPC_SET_DEXCR_ASPECT(a, b, c) …
#endif
int overflowuid = …;
int overflowgid = …;
EXPORT_SYMBOL(…);
EXPORT_SYMBOL(…);
int fs_overflowuid = …;
int fs_overflowgid = …;
EXPORT_SYMBOL(…);
EXPORT_SYMBOL(…);
static bool set_one_prio_perm(struct task_struct *p)
{ … }
static int set_one_prio(struct task_struct *p, int niceval, int error)
{ … }
SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
{ … }
SYSCALL_DEFINE2(getpriority, int, which, int, who)
{ … }
#ifdef CONFIG_MULTIUSER
long __sys_setregid(gid_t rgid, gid_t egid)
{ … }
SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid)
{ … }
long __sys_setgid(gid_t gid)
{ … }
SYSCALL_DEFINE1(setgid, gid_t, gid)
{ … }
static int set_user(struct cred *new)
{ … }
static void flag_nproc_exceeded(struct cred *new)
{ … }
long __sys_setreuid(uid_t ruid, uid_t euid)
{ … }
SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid)
{ … }
long __sys_setuid(uid_t uid)
{ … }
SYSCALL_DEFINE1(setuid, uid_t, uid)
{ … }
long __sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
{ … }
SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
{ … }
SYSCALL_DEFINE3(getresuid, uid_t __user *, ruidp, uid_t __user *, euidp, uid_t __user *, suidp)
{ … }
long __sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
{ … }
SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid)
{ … }
SYSCALL_DEFINE3(getresgid, gid_t __user *, rgidp, gid_t __user *, egidp, gid_t __user *, sgidp)
{ … }
long __sys_setfsuid(uid_t uid)
{ … }
SYSCALL_DEFINE1(setfsuid, uid_t, uid)
{ … }
long __sys_setfsgid(gid_t gid)
{ … }
SYSCALL_DEFINE1(setfsgid, gid_t, gid)
{ … }
#endif
SYSCALL_DEFINE0(…)
{ …
SYSCALL_DEFINE0(…)
{ …
SYSCALL_DEFINE0(getppid)
{ … }
SYSCALL_DEFINE0(…)
{ …
SYSCALL_DEFINE0(…)
{ …
SYSCALL_DEFINE0(…)
{ …
SYSCALL_DEFINE0(…)
{ …
static void do_sys_times(struct tms *tms)
{ … }
SYSCALL_DEFINE1(times, struct tms __user *, tbuf)
{ … }
#ifdef CONFIG_COMPAT
static compat_clock_t clock_t_to_compat_clock_t(clock_t x)
{ … }
COMPAT_SYSCALL_DEFINE1(times, struct compat_tms __user *, tbuf)
{ … }
#endif
SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
{ … }
static int do_getpgid(pid_t pid)
{ … }
SYSCALL_DEFINE1(getpgid, pid_t, pid)
{ … }
#ifdef __ARCH_WANT_SYS_GETPGRP
SYSCALL_DEFINE0(…)
{ …
#endif
SYSCALL_DEFINE1(getsid, pid_t, pid)
{ … }
static void set_special_pids(struct pid *pid)
{ … }
int ksys_setsid(void)
{ … }
SYSCALL_DEFINE0(…)
{ …
DECLARE_RWSEM(…) …;
#ifdef COMPAT_UTS_MACHINE
#define override_architecture(name) …
#else
#define override_architecture …
#endif
static int override_release(char __user *release, size_t len)
{ … }
SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
{ … }
#ifdef __ARCH_WANT_SYS_OLD_UNAME
SYSCALL_DEFINE1(uname, struct old_utsname __user *, name)
{ … }
SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
{ … }
#endif
SYSCALL_DEFINE2(sethostname, char __user *, name, int, len)
{ … }
#ifdef __ARCH_WANT_SYS_GETHOSTNAME
SYSCALL_DEFINE2(gethostname, char __user *, name, int, len)
{ … }
#endif
SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len)
{ … }
static int do_prlimit(struct task_struct *tsk, unsigned int resource,
struct rlimit *new_rlim, struct rlimit *old_rlim)
{ … }
SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim)
{ … }
#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE2(setrlimit, unsigned int, resource,
struct compat_rlimit __user *, rlim)
{ … }
COMPAT_SYSCALL_DEFINE2(getrlimit, unsigned int, resource,
struct compat_rlimit __user *, rlim)
{ … }
#endif
#ifdef __ARCH_WANT_SYS_OLD_GETRLIMIT
SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
struct rlimit __user *, rlim)
{ … }
#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
struct compat_rlimit __user *, rlim)
{ … }
#endif
#endif
static inline bool rlim64_is_infinity(__u64 rlim64)
{ … }
static void rlim_to_rlim64(const struct rlimit *rlim, struct rlimit64 *rlim64)
{ … }
static void rlim64_to_rlim(const struct rlimit64 *rlim64, struct rlimit *rlim)
{ … }
static int check_prlimit_permission(struct task_struct *task,
unsigned int flags)
{ … }
SYSCALL_DEFINE4(prlimit64, pid_t, pid, unsigned int, resource,
const struct rlimit64 __user *, new_rlim,
struct rlimit64 __user *, old_rlim)
{ … }
SYSCALL_DEFINE2(setrlimit, unsigned int, resource, struct rlimit __user *, rlim)
{ … }
static void accumulate_thread_rusage(struct task_struct *t, struct rusage *r)
{ … }
void getrusage(struct task_struct *p, int who, struct rusage *r)
{ … }
SYSCALL_DEFINE2(getrusage, int, who, struct rusage __user *, ru)
{ … }
#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE2(getrusage, int, who, struct compat_rusage __user *, ru)
{ … }
#endif
SYSCALL_DEFINE1(umask, int, mask)
{ … }
static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
{ … }
static int validate_prctl_map_addr(struct prctl_mm_map *prctl_map)
{ … }
#ifdef CONFIG_CHECKPOINT_RESTORE
static int prctl_set_mm_map(int opt, const void __user *addr, unsigned long data_size)
{ … }
#endif
static int prctl_set_auxv(struct mm_struct *mm, unsigned long addr,
unsigned long len)
{ … }
static int prctl_set_mm(int opt, unsigned long addr,
unsigned long arg4, unsigned long arg5)
{ … }
#ifdef CONFIG_CHECKPOINT_RESTORE
static int prctl_get_tid_address(struct task_struct *me, int __user * __user *tid_addr)
{ … }
#else
static int prctl_get_tid_address(struct task_struct *me, int __user * __user *tid_addr)
{
return -EINVAL;
}
#endif
static int propagate_has_child_subreaper(struct task_struct *p, void *data)
{ … }
int __weak arch_prctl_spec_ctrl_get(struct task_struct *t, unsigned long which)
{ … }
int __weak arch_prctl_spec_ctrl_set(struct task_struct *t, unsigned long which,
unsigned long ctrl)
{ … }
#define PR_IO_FLUSHER …
#ifdef CONFIG_ANON_VMA_NAME
#define ANON_VMA_NAME_MAX_LEN …
#define ANON_VMA_NAME_INVALID_CHARS …
static inline bool is_valid_name_char(char ch)
{ … }
static int prctl_set_vma(unsigned long opt, unsigned long addr,
unsigned long size, unsigned long arg)
{ … }
#else
static int prctl_set_vma(unsigned long opt, unsigned long start,
unsigned long size, unsigned long arg)
{
return -EINVAL;
}
#endif
static inline unsigned long get_current_mdwe(void)
{ … }
static inline int prctl_set_mdwe(unsigned long bits, unsigned long arg3,
unsigned long arg4, unsigned long arg5)
{ … }
static inline int prctl_get_mdwe(unsigned long arg2, unsigned long arg3,
unsigned long arg4, unsigned long arg5)
{ … }
static int prctl_get_auxv(void __user *addr, unsigned long len)
{ … }
SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
unsigned long, arg4, unsigned long, arg5)
{ … }
SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep,
struct getcpu_cache __user *, unused)
{ … }
static int do_sysinfo(struct sysinfo *info)
{ … }
SYSCALL_DEFINE1(sysinfo, struct sysinfo __user *, info)
{ … }
#ifdef CONFIG_COMPAT
struct compat_sysinfo { … };
COMPAT_SYSCALL_DEFINE1(sysinfo, struct compat_sysinfo __user *, info)
{ … }
#endif