Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | |
| 3 | #include <linux/linkage.h> |
| 4 | #include <linux/errno.h> |
| 5 | |
| 6 | #include <asm/unistd.h> |
| 7 | |
Dominik Brodowski | 7303e30 | 2018-04-05 11:53:03 +0200 | [diff] [blame] | 8 | #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER |
| 9 | /* Architectures may override COND_SYSCALL and COND_SYSCALL_COMPAT */ |
| 10 | #include <asm/syscall_wrapper.h> |
| 11 | #endif /* CONFIG_ARCH_HAS_SYSCALL_WRAPPER */ |
| 12 | |
Adrian Bunk | 0732a55 | 2007-10-16 23:29:25 -0700 | [diff] [blame] | 13 | /* we can't #include <linux/syscalls.h> here, |
| 14 | but tell gcc to not warn with -Wmissing-prototypes */ |
| 15 | asmlinkage long sys_ni_syscall(void); |
| 16 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | /* |
| 18 | * Non-implemented system calls get redirected here. |
| 19 | */ |
| 20 | asmlinkage long sys_ni_syscall(void) |
| 21 | { |
| 22 | return -ENOSYS; |
| 23 | } |
| 24 | |
Dominik Brodowski | 7303e30 | 2018-04-05 11:53:03 +0200 | [diff] [blame] | 25 | #ifndef COND_SYSCALL |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 26 | #define COND_SYSCALL(name) cond_syscall(sys_##name) |
Dominik Brodowski | 7303e30 | 2018-04-05 11:53:03 +0200 | [diff] [blame] | 27 | #endif /* COND_SYSCALL */ |
| 28 | |
| 29 | #ifndef COND_SYSCALL_COMPAT |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 30 | #define COND_SYSCALL_COMPAT(name) cond_syscall(compat_sys_##name) |
Dominik Brodowski | 7303e30 | 2018-04-05 11:53:03 +0200 | [diff] [blame] | 31 | #endif /* COND_SYSCALL_COMPAT */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 32 | |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 33 | /* |
| 34 | * This list is kept in the same order as include/uapi/asm-generic/unistd.h. |
| 35 | * Architecture specific entries go below, followed by deprecated or obsolete |
| 36 | * system calls. |
| 37 | */ |
| 38 | |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 39 | COND_SYSCALL(io_setup); |
| 40 | COND_SYSCALL_COMPAT(io_setup); |
| 41 | COND_SYSCALL(io_destroy); |
| 42 | COND_SYSCALL(io_submit); |
| 43 | COND_SYSCALL_COMPAT(io_submit); |
| 44 | COND_SYSCALL(io_cancel); |
Arnd Bergmann | 8dabe72 | 2019-01-07 00:33:08 +0100 | [diff] [blame] | 45 | COND_SYSCALL(io_getevents_time32); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 46 | COND_SYSCALL(io_getevents); |
Arnd Bergmann | 8dabe72 | 2019-01-07 00:33:08 +0100 | [diff] [blame] | 47 | COND_SYSCALL(io_pgetevents_time32); |
Christoph Hellwig | 7a074e9 | 2018-05-02 19:51:00 +0200 | [diff] [blame] | 48 | COND_SYSCALL(io_pgetevents); |
Arnd Bergmann | 8dabe72 | 2019-01-07 00:33:08 +0100 | [diff] [blame] | 49 | COND_SYSCALL_COMPAT(io_pgetevents_time32); |
Christoph Hellwig | 7a074e9 | 2018-05-02 19:51:00 +0200 | [diff] [blame] | 50 | COND_SYSCALL_COMPAT(io_pgetevents); |
Jens Axboe | 2b188cc | 2019-01-07 10:46:33 -0700 | [diff] [blame] | 51 | COND_SYSCALL(io_uring_setup); |
| 52 | COND_SYSCALL(io_uring_enter); |
Jens Axboe | edafcce | 2019-01-09 09:16:05 -0700 | [diff] [blame] | 53 | COND_SYSCALL(io_uring_register); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 54 | |
| 55 | /* fs/xattr.c */ |
| 56 | |
| 57 | /* fs/dcache.c */ |
| 58 | |
| 59 | /* fs/cookies.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 60 | COND_SYSCALL(lookup_dcookie); |
| 61 | COND_SYSCALL_COMPAT(lookup_dcookie); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 62 | |
| 63 | /* fs/eventfd.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 64 | COND_SYSCALL(eventfd2); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 65 | |
| 66 | /* fs/eventfd.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 67 | COND_SYSCALL(epoll_create1); |
| 68 | COND_SYSCALL(epoll_ctl); |
| 69 | COND_SYSCALL(epoll_pwait); |
| 70 | COND_SYSCALL_COMPAT(epoll_pwait); |
Willem de Bruijn | b0a0c26 | 2020-12-18 14:05:41 -0800 | [diff] [blame] | 71 | COND_SYSCALL(epoll_pwait2); |
| 72 | COND_SYSCALL_COMPAT(epoll_pwait2); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 73 | |
| 74 | /* fs/fcntl.c */ |
| 75 | |
| 76 | /* fs/inotify_user.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 77 | COND_SYSCALL(inotify_init1); |
| 78 | COND_SYSCALL(inotify_add_watch); |
| 79 | COND_SYSCALL(inotify_rm_watch); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 80 | |
| 81 | /* fs/ioctl.c */ |
| 82 | |
| 83 | /* fs/ioprio.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 84 | COND_SYSCALL(ioprio_set); |
| 85 | COND_SYSCALL(ioprio_get); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 86 | |
| 87 | /* fs/locks.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 88 | COND_SYSCALL(flock); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 89 | |
| 90 | /* fs/namei.c */ |
| 91 | |
| 92 | /* fs/namespace.c */ |
| 93 | |
| 94 | /* fs/nfsctl.c */ |
| 95 | |
| 96 | /* fs/open.c */ |
| 97 | |
| 98 | /* fs/pipe.c */ |
| 99 | |
| 100 | /* fs/quota.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 101 | COND_SYSCALL(quotactl); |
Jan Kara | 64c2c2c | 2021-05-25 16:07:48 +0200 | [diff] [blame] | 102 | COND_SYSCALL(quotactl_fd); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 103 | |
| 104 | /* fs/readdir.c */ |
| 105 | |
| 106 | /* fs/read_write.c */ |
| 107 | |
| 108 | /* fs/sendfile.c */ |
| 109 | |
| 110 | /* fs/select.c */ |
| 111 | |
| 112 | /* fs/signalfd.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 113 | COND_SYSCALL(signalfd4); |
| 114 | COND_SYSCALL_COMPAT(signalfd4); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 115 | |
| 116 | /* fs/splice.c */ |
| 117 | |
| 118 | /* fs/stat.c */ |
| 119 | |
| 120 | /* fs/sync.c */ |
| 121 | |
| 122 | /* fs/timerfd.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 123 | COND_SYSCALL(timerfd_create); |
| 124 | COND_SYSCALL(timerfd_settime); |
Arnd Bergmann | 8dabe72 | 2019-01-07 00:33:08 +0100 | [diff] [blame] | 125 | COND_SYSCALL(timerfd_settime32); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 126 | COND_SYSCALL(timerfd_gettime); |
Arnd Bergmann | 8dabe72 | 2019-01-07 00:33:08 +0100 | [diff] [blame] | 127 | COND_SYSCALL(timerfd_gettime32); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 128 | |
| 129 | /* fs/utimes.c */ |
| 130 | |
| 131 | /* kernel/acct.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 132 | COND_SYSCALL(acct); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 133 | |
| 134 | /* kernel/capability.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 135 | COND_SYSCALL(capget); |
| 136 | COND_SYSCALL(capset); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 137 | |
| 138 | /* kernel/exec_domain.c */ |
| 139 | |
| 140 | /* kernel/exit.c */ |
| 141 | |
| 142 | /* kernel/fork.c */ |
Christian Brauner | d68dbb0 | 2019-06-21 01:26:35 +0200 | [diff] [blame] | 143 | /* __ARCH_WANT_SYS_CLONE3 */ |
| 144 | COND_SYSCALL(clone3); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 145 | |
| 146 | /* kernel/futex.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 147 | COND_SYSCALL(futex); |
Arnd Bergmann | 8dabe72 | 2019-01-07 00:33:08 +0100 | [diff] [blame] | 148 | COND_SYSCALL(futex_time32); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 149 | COND_SYSCALL(set_robust_list); |
| 150 | COND_SYSCALL_COMPAT(set_robust_list); |
| 151 | COND_SYSCALL(get_robust_list); |
| 152 | COND_SYSCALL_COMPAT(get_robust_list); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 153 | |
| 154 | /* kernel/hrtimer.c */ |
| 155 | |
| 156 | /* kernel/itimer.c */ |
| 157 | |
| 158 | /* kernel/kexec.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 159 | COND_SYSCALL(kexec_load); |
| 160 | COND_SYSCALL_COMPAT(kexec_load); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 161 | |
| 162 | /* kernel/module.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 163 | COND_SYSCALL(init_module); |
| 164 | COND_SYSCALL(delete_module); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 165 | |
| 166 | /* kernel/posix-timers.c */ |
| 167 | |
| 168 | /* kernel/printk.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 169 | COND_SYSCALL(syslog); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 170 | |
| 171 | /* kernel/ptrace.c */ |
| 172 | |
| 173 | /* kernel/sched/core.c */ |
| 174 | |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 175 | /* kernel/sys.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 176 | COND_SYSCALL(setregid); |
| 177 | COND_SYSCALL(setgid); |
| 178 | COND_SYSCALL(setreuid); |
| 179 | COND_SYSCALL(setuid); |
| 180 | COND_SYSCALL(setresuid); |
| 181 | COND_SYSCALL(getresuid); |
| 182 | COND_SYSCALL(setresgid); |
| 183 | COND_SYSCALL(getresgid); |
| 184 | COND_SYSCALL(setfsuid); |
| 185 | COND_SYSCALL(setfsgid); |
| 186 | COND_SYSCALL(setgroups); |
| 187 | COND_SYSCALL(getgroups); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 188 | |
| 189 | /* kernel/time.c */ |
| 190 | |
| 191 | /* kernel/timer.c */ |
| 192 | |
| 193 | /* ipc/mqueue.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 194 | COND_SYSCALL(mq_open); |
| 195 | COND_SYSCALL_COMPAT(mq_open); |
| 196 | COND_SYSCALL(mq_unlink); |
| 197 | COND_SYSCALL(mq_timedsend); |
Arnd Bergmann | 8dabe72 | 2019-01-07 00:33:08 +0100 | [diff] [blame] | 198 | COND_SYSCALL(mq_timedsend_time32); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 199 | COND_SYSCALL(mq_timedreceive); |
Arnd Bergmann | 8dabe72 | 2019-01-07 00:33:08 +0100 | [diff] [blame] | 200 | COND_SYSCALL(mq_timedreceive_time32); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 201 | COND_SYSCALL(mq_notify); |
| 202 | COND_SYSCALL_COMPAT(mq_notify); |
| 203 | COND_SYSCALL(mq_getsetattr); |
| 204 | COND_SYSCALL_COMPAT(mq_getsetattr); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 205 | |
| 206 | /* ipc/msg.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 207 | COND_SYSCALL(msgget); |
Arnd Bergmann | 275f221 | 2018-12-31 22:22:40 +0100 | [diff] [blame] | 208 | COND_SYSCALL(old_msgctl); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 209 | COND_SYSCALL(msgctl); |
| 210 | COND_SYSCALL_COMPAT(msgctl); |
Arnd Bergmann | 7e89a37 | 2019-02-28 15:22:53 +0100 | [diff] [blame] | 211 | COND_SYSCALL_COMPAT(old_msgctl); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 212 | COND_SYSCALL(msgrcv); |
| 213 | COND_SYSCALL_COMPAT(msgrcv); |
| 214 | COND_SYSCALL(msgsnd); |
| 215 | COND_SYSCALL_COMPAT(msgsnd); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 216 | |
| 217 | /* ipc/sem.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 218 | COND_SYSCALL(semget); |
Arnd Bergmann | 275f221 | 2018-12-31 22:22:40 +0100 | [diff] [blame] | 219 | COND_SYSCALL(old_semctl); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 220 | COND_SYSCALL(semctl); |
| 221 | COND_SYSCALL_COMPAT(semctl); |
Arnd Bergmann | 7e89a37 | 2019-02-28 15:22:53 +0100 | [diff] [blame] | 222 | COND_SYSCALL_COMPAT(old_semctl); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 223 | COND_SYSCALL(semtimedop); |
Arnd Bergmann | 8dabe72 | 2019-01-07 00:33:08 +0100 | [diff] [blame] | 224 | COND_SYSCALL(semtimedop_time32); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 225 | COND_SYSCALL(semop); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 226 | |
| 227 | /* ipc/shm.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 228 | COND_SYSCALL(shmget); |
Arnd Bergmann | 275f221 | 2018-12-31 22:22:40 +0100 | [diff] [blame] | 229 | COND_SYSCALL(old_shmctl); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 230 | COND_SYSCALL(shmctl); |
| 231 | COND_SYSCALL_COMPAT(shmctl); |
Arnd Bergmann | 7e89a37 | 2019-02-28 15:22:53 +0100 | [diff] [blame] | 232 | COND_SYSCALL_COMPAT(old_shmctl); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 233 | COND_SYSCALL(shmat); |
| 234 | COND_SYSCALL_COMPAT(shmat); |
| 235 | COND_SYSCALL(shmdt); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 236 | |
| 237 | /* net/socket.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 238 | COND_SYSCALL(socket); |
| 239 | COND_SYSCALL(socketpair); |
| 240 | COND_SYSCALL(bind); |
| 241 | COND_SYSCALL(listen); |
| 242 | COND_SYSCALL(accept); |
| 243 | COND_SYSCALL(connect); |
| 244 | COND_SYSCALL(getsockname); |
| 245 | COND_SYSCALL(getpeername); |
| 246 | COND_SYSCALL(setsockopt); |
| 247 | COND_SYSCALL_COMPAT(setsockopt); |
| 248 | COND_SYSCALL(getsockopt); |
| 249 | COND_SYSCALL_COMPAT(getsockopt); |
| 250 | COND_SYSCALL(sendto); |
| 251 | COND_SYSCALL(shutdown); |
| 252 | COND_SYSCALL(recvfrom); |
| 253 | COND_SYSCALL_COMPAT(recvfrom); |
| 254 | COND_SYSCALL(sendmsg); |
| 255 | COND_SYSCALL_COMPAT(sendmsg); |
| 256 | COND_SYSCALL(recvmsg); |
| 257 | COND_SYSCALL_COMPAT(recvmsg); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 258 | |
| 259 | /* mm/filemap.c */ |
| 260 | |
| 261 | /* mm/nommu.c, also with MMU */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 262 | COND_SYSCALL(mremap); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 263 | |
| 264 | /* security/keys/keyctl.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 265 | COND_SYSCALL(add_key); |
| 266 | COND_SYSCALL(request_key); |
| 267 | COND_SYSCALL(keyctl); |
| 268 | COND_SYSCALL_COMPAT(keyctl); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 269 | |
Mickaël Salaün | 265885d | 2021-04-22 17:41:18 +0200 | [diff] [blame] | 270 | /* security/landlock/syscalls.c */ |
| 271 | COND_SYSCALL(landlock_create_ruleset); |
| 272 | COND_SYSCALL(landlock_add_rule); |
| 273 | COND_SYSCALL(landlock_restrict_self); |
| 274 | |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 275 | /* arch/example/kernel/sys_example.c */ |
| 276 | |
| 277 | /* mm/fadvise.c */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 278 | COND_SYSCALL(fadvise64_64); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 279 | |
| 280 | /* mm/, CONFIG_MMU only */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 281 | COND_SYSCALL(swapon); |
| 282 | COND_SYSCALL(swapoff); |
| 283 | COND_SYSCALL(mprotect); |
| 284 | COND_SYSCALL(msync); |
| 285 | COND_SYSCALL(mlock); |
| 286 | COND_SYSCALL(munlock); |
| 287 | COND_SYSCALL(mlockall); |
| 288 | COND_SYSCALL(munlockall); |
| 289 | COND_SYSCALL(mincore); |
| 290 | COND_SYSCALL(madvise); |
Minchan Kim | ecb8ac8 | 2020-10-17 16:14:59 -0700 | [diff] [blame] | 291 | COND_SYSCALL(process_madvise); |
Suren Baghdasaryan | dce4910 | 2021-09-02 15:00:33 -0700 | [diff] [blame^] | 292 | COND_SYSCALL(process_mrelease); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 293 | COND_SYSCALL(remap_file_pages); |
| 294 | COND_SYSCALL(mbind); |
| 295 | COND_SYSCALL_COMPAT(mbind); |
| 296 | COND_SYSCALL(get_mempolicy); |
| 297 | COND_SYSCALL_COMPAT(get_mempolicy); |
| 298 | COND_SYSCALL(set_mempolicy); |
| 299 | COND_SYSCALL_COMPAT(set_mempolicy); |
| 300 | COND_SYSCALL(migrate_pages); |
| 301 | COND_SYSCALL_COMPAT(migrate_pages); |
| 302 | COND_SYSCALL(move_pages); |
| 303 | COND_SYSCALL_COMPAT(move_pages); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 304 | |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 305 | COND_SYSCALL(perf_event_open); |
| 306 | COND_SYSCALL(accept4); |
| 307 | COND_SYSCALL(recvmmsg); |
Arnd Bergmann | e11d428 | 2018-04-18 13:43:52 +0200 | [diff] [blame] | 308 | COND_SYSCALL(recvmmsg_time32); |
Arnd Bergmann | 8dabe72 | 2019-01-07 00:33:08 +0100 | [diff] [blame] | 309 | COND_SYSCALL_COMPAT(recvmmsg_time32); |
Arnd Bergmann | e11d428 | 2018-04-18 13:43:52 +0200 | [diff] [blame] | 310 | COND_SYSCALL_COMPAT(recvmmsg_time64); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 311 | |
| 312 | /* |
| 313 | * Architecture specific syscalls: see further below |
| 314 | */ |
| 315 | |
| 316 | /* fanotify */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 317 | COND_SYSCALL(fanotify_init); |
| 318 | COND_SYSCALL(fanotify_mark); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 319 | |
| 320 | /* open by handle */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 321 | COND_SYSCALL(name_to_handle_at); |
| 322 | COND_SYSCALL(open_by_handle_at); |
| 323 | COND_SYSCALL_COMPAT(open_by_handle_at); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 324 | |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 325 | COND_SYSCALL(sendmmsg); |
| 326 | COND_SYSCALL_COMPAT(sendmmsg); |
| 327 | COND_SYSCALL(process_vm_readv); |
| 328 | COND_SYSCALL_COMPAT(process_vm_readv); |
| 329 | COND_SYSCALL(process_vm_writev); |
| 330 | COND_SYSCALL_COMPAT(process_vm_writev); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 331 | |
| 332 | /* compare kernel pointers */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 333 | COND_SYSCALL(kcmp); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 334 | |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 335 | COND_SYSCALL(finit_module); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 336 | |
| 337 | /* operate on Secure Computing state */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 338 | COND_SYSCALL(seccomp); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 339 | |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 340 | COND_SYSCALL(memfd_create); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 341 | |
| 342 | /* access BPF programs and maps */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 343 | COND_SYSCALL(bpf); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 344 | |
| 345 | /* execveat */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 346 | COND_SYSCALL(execveat); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 347 | |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 348 | COND_SYSCALL(userfaultfd); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 349 | |
| 350 | /* membarrier */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 351 | COND_SYSCALL(membarrier); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 352 | |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 353 | COND_SYSCALL(mlock2); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 354 | |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 355 | COND_SYSCALL(copy_file_range); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 356 | |
| 357 | /* memory protection keys */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 358 | COND_SYSCALL(pkey_mprotect); |
| 359 | COND_SYSCALL(pkey_alloc); |
| 360 | COND_SYSCALL(pkey_free); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 361 | |
Mike Rapoport | 1507f51 | 2021-07-07 18:08:03 -0700 | [diff] [blame] | 362 | /* memfd_secret */ |
| 363 | COND_SYSCALL(memfd_secret); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 364 | |
| 365 | /* |
| 366 | * Architecture specific weak syscall entries. |
| 367 | */ |
| 368 | |
| 369 | /* pciconfig: alpha, arm, arm64, ia64, sparc */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 370 | COND_SYSCALL(pciconfig_read); |
| 371 | COND_SYSCALL(pciconfig_write); |
| 372 | COND_SYSCALL(pciconfig_iobase); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 373 | |
| 374 | /* sys_socketcall: arm, mips, x86, ... */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 375 | COND_SYSCALL(socketcall); |
| 376 | COND_SYSCALL_COMPAT(socketcall); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 377 | |
| 378 | /* compat syscalls for arm64, x86, ... */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 379 | COND_SYSCALL_COMPAT(fanotify_mark); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 380 | |
| 381 | /* x86 */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 382 | COND_SYSCALL(vm86old); |
| 383 | COND_SYSCALL(modify_ldt); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 384 | COND_SYSCALL(vm86); |
| 385 | COND_SYSCALL(kexec_file_load); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 386 | |
| 387 | /* s390 */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 388 | COND_SYSCALL(s390_pci_mmio_read); |
| 389 | COND_SYSCALL(s390_pci_mmio_write); |
Arnd Bergmann | 58fa4a4 | 2019-01-16 14:15:20 +0100 | [diff] [blame] | 390 | COND_SYSCALL(s390_ipc); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 391 | COND_SYSCALL_COMPAT(s390_ipc); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 392 | |
| 393 | /* powerpc */ |
Al Viro | 4c392e6 | 2018-05-02 23:20:48 +1000 | [diff] [blame] | 394 | COND_SYSCALL(rtas); |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 395 | COND_SYSCALL(spu_run); |
| 396 | COND_SYSCALL(spu_create); |
| 397 | COND_SYSCALL(subpage_prot); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 398 | |
| 399 | |
| 400 | /* |
| 401 | * Deprecated system calls which are still defined in |
| 402 | * include/uapi/asm-generic/unistd.h and wanted by >= 1 arch |
| 403 | */ |
| 404 | |
| 405 | /* __ARCH_WANT_SYSCALL_NO_FLAGS */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 406 | COND_SYSCALL(epoll_create); |
| 407 | COND_SYSCALL(inotify_init); |
| 408 | COND_SYSCALL(eventfd); |
| 409 | COND_SYSCALL(signalfd); |
| 410 | COND_SYSCALL_COMPAT(signalfd); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 411 | |
| 412 | /* __ARCH_WANT_SYSCALL_OFF_T */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 413 | COND_SYSCALL(fadvise64); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 414 | |
| 415 | /* __ARCH_WANT_SYSCALL_DEPRECATED */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 416 | COND_SYSCALL(epoll_wait); |
| 417 | COND_SYSCALL(recv); |
| 418 | COND_SYSCALL_COMPAT(recv); |
| 419 | COND_SYSCALL(send); |
| 420 | COND_SYSCALL(bdflush); |
| 421 | COND_SYSCALL(uselib); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 422 | |
Arnd Bergmann | 942437c | 2019-07-15 11:46:10 +0200 | [diff] [blame] | 423 | /* optional: time32 */ |
| 424 | COND_SYSCALL(time32); |
| 425 | COND_SYSCALL(stime32); |
| 426 | COND_SYSCALL(utime32); |
| 427 | COND_SYSCALL(adjtimex_time32); |
| 428 | COND_SYSCALL(sched_rr_get_interval_time32); |
| 429 | COND_SYSCALL(nanosleep_time32); |
| 430 | COND_SYSCALL(rt_sigtimedwait_time32); |
| 431 | COND_SYSCALL_COMPAT(rt_sigtimedwait_time32); |
| 432 | COND_SYSCALL(timer_settime32); |
| 433 | COND_SYSCALL(timer_gettime32); |
| 434 | COND_SYSCALL(clock_settime32); |
| 435 | COND_SYSCALL(clock_gettime32); |
| 436 | COND_SYSCALL(clock_getres_time32); |
| 437 | COND_SYSCALL(clock_nanosleep_time32); |
| 438 | COND_SYSCALL(utimes_time32); |
| 439 | COND_SYSCALL(futimesat_time32); |
| 440 | COND_SYSCALL(pselect6_time32); |
| 441 | COND_SYSCALL_COMPAT(pselect6_time32); |
| 442 | COND_SYSCALL(ppoll_time32); |
| 443 | COND_SYSCALL_COMPAT(ppoll_time32); |
| 444 | COND_SYSCALL(utimensat_time32); |
| 445 | COND_SYSCALL(clock_adjtime32); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 446 | |
| 447 | /* |
| 448 | * The syscalls below are not found in include/uapi/asm-generic/unistd.h |
| 449 | */ |
| 450 | |
| 451 | /* obsolete: SGETMASK_SYSCALL */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 452 | COND_SYSCALL(sgetmask); |
| 453 | COND_SYSCALL(ssetmask); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 454 | |
| 455 | /* obsolete: SYSFS_SYSCALL */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 456 | COND_SYSCALL(sysfs); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 457 | |
| 458 | /* obsolete: __ARCH_WANT_SYS_IPC */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 459 | COND_SYSCALL(ipc); |
| 460 | COND_SYSCALL_COMPAT(ipc); |
Dominik Brodowski | 70dd4b3 | 2018-03-06 19:53:01 +0100 | [diff] [blame] | 461 | |
| 462 | /* obsolete: UID16 */ |
Dominik Brodowski | 67a7acd | 2018-03-04 19:06:35 +0100 | [diff] [blame] | 463 | COND_SYSCALL(chown16); |
| 464 | COND_SYSCALL(fchown16); |
| 465 | COND_SYSCALL(getegid16); |
| 466 | COND_SYSCALL(geteuid16); |
| 467 | COND_SYSCALL(getgid16); |
| 468 | COND_SYSCALL(getgroups16); |
| 469 | COND_SYSCALL(getresgid16); |
| 470 | COND_SYSCALL(getresuid16); |
| 471 | COND_SYSCALL(getuid16); |
| 472 | COND_SYSCALL(lchown16); |
| 473 | COND_SYSCALL(setfsgid16); |
| 474 | COND_SYSCALL(setfsuid16); |
| 475 | COND_SYSCALL(setgid16); |
| 476 | COND_SYSCALL(setgroups16); |
| 477 | COND_SYSCALL(setregid16); |
| 478 | COND_SYSCALL(setresgid16); |
| 479 | COND_SYSCALL(setresuid16); |
| 480 | COND_SYSCALL(setreuid16); |
| 481 | COND_SYSCALL(setuid16); |
Mathieu Desnoyers | d7822b1 | 2018-06-02 08:43:54 -0400 | [diff] [blame] | 482 | |
| 483 | /* restartable sequence */ |
| 484 | COND_SYSCALL(rseq); |