xref: /openbmc/linux/kernel/sys_ni.c (revision e639c869)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/linkage.h>
4 #include <linux/errno.h>
5 
6 #include <asm/unistd.h>
7 
8 /*  we can't #include <linux/syscalls.h> here,
9     but tell gcc to not warn with -Wmissing-prototypes  */
10 asmlinkage long sys_ni_syscall(void);
11 
12 /*
13  * Non-implemented system calls get redirected here.
14  */
15 asmlinkage long sys_ni_syscall(void)
16 {
17 	return -ENOSYS;
18 }
19 
20 cond_syscall(sys_quotactl);
21 cond_syscall(sys32_quotactl);
22 cond_syscall(sys_acct);
23 cond_syscall(sys_lookup_dcookie);
24 cond_syscall(compat_sys_lookup_dcookie);
25 cond_syscall(sys_swapon);
26 cond_syscall(sys_swapoff);
27 cond_syscall(sys_kexec_load);
28 cond_syscall(compat_sys_kexec_load);
29 cond_syscall(sys_kexec_file_load);
30 cond_syscall(sys_init_module);
31 cond_syscall(sys_finit_module);
32 cond_syscall(sys_delete_module);
33 cond_syscall(sys_socketpair);
34 cond_syscall(sys_bind);
35 cond_syscall(sys_listen);
36 cond_syscall(sys_accept);
37 cond_syscall(sys_accept4);
38 cond_syscall(sys_connect);
39 cond_syscall(sys_getsockname);
40 cond_syscall(sys_getpeername);
41 cond_syscall(sys_sendto);
42 cond_syscall(sys_send);
43 cond_syscall(sys_recvfrom);
44 cond_syscall(sys_recv);
45 cond_syscall(sys_socket);
46 cond_syscall(sys_setsockopt);
47 cond_syscall(compat_sys_setsockopt);
48 cond_syscall(sys_getsockopt);
49 cond_syscall(compat_sys_getsockopt);
50 cond_syscall(sys_shutdown);
51 cond_syscall(sys_sendmsg);
52 cond_syscall(sys_sendmmsg);
53 cond_syscall(compat_sys_sendmsg);
54 cond_syscall(compat_sys_sendmmsg);
55 cond_syscall(sys_recvmsg);
56 cond_syscall(sys_recvmmsg);
57 cond_syscall(compat_sys_recvmsg);
58 cond_syscall(compat_sys_recv);
59 cond_syscall(compat_sys_recvfrom);
60 cond_syscall(compat_sys_recvmmsg);
61 cond_syscall(sys_socketcall);
62 cond_syscall(sys_futex);
63 cond_syscall(compat_sys_futex);
64 cond_syscall(sys_set_robust_list);
65 cond_syscall(compat_sys_set_robust_list);
66 cond_syscall(sys_get_robust_list);
67 cond_syscall(compat_sys_get_robust_list);
68 cond_syscall(sys_epoll_create);
69 cond_syscall(sys_epoll_create1);
70 cond_syscall(sys_epoll_ctl);
71 cond_syscall(sys_epoll_wait);
72 cond_syscall(sys_epoll_pwait);
73 cond_syscall(compat_sys_epoll_pwait);
74 cond_syscall(sys_semget);
75 cond_syscall(sys_semop);
76 cond_syscall(sys_semtimedop);
77 cond_syscall(compat_sys_semtimedop);
78 cond_syscall(sys_semctl);
79 cond_syscall(compat_sys_semctl);
80 cond_syscall(sys_msgget);
81 cond_syscall(sys_msgsnd);
82 cond_syscall(compat_sys_msgsnd);
83 cond_syscall(sys_msgrcv);
84 cond_syscall(compat_sys_msgrcv);
85 cond_syscall(sys_msgctl);
86 cond_syscall(compat_sys_msgctl);
87 cond_syscall(sys_shmget);
88 cond_syscall(sys_shmat);
89 cond_syscall(compat_sys_shmat);
90 cond_syscall(sys_shmdt);
91 cond_syscall(sys_shmctl);
92 cond_syscall(compat_sys_shmctl);
93 cond_syscall(sys_mq_open);
94 cond_syscall(sys_mq_unlink);
95 cond_syscall(sys_mq_timedsend);
96 cond_syscall(sys_mq_timedreceive);
97 cond_syscall(sys_mq_notify);
98 cond_syscall(sys_mq_getsetattr);
99 cond_syscall(compat_sys_mq_open);
100 cond_syscall(compat_sys_mq_timedsend);
101 cond_syscall(compat_sys_mq_timedreceive);
102 cond_syscall(compat_sys_mq_notify);
103 cond_syscall(compat_sys_mq_getsetattr);
104 cond_syscall(sys_mbind);
105 cond_syscall(sys_get_mempolicy);
106 cond_syscall(sys_set_mempolicy);
107 cond_syscall(compat_sys_mbind);
108 cond_syscall(compat_sys_get_mempolicy);
109 cond_syscall(compat_sys_set_mempolicy);
110 cond_syscall(sys_add_key);
111 cond_syscall(sys_request_key);
112 cond_syscall(sys_keyctl);
113 cond_syscall(compat_sys_keyctl);
114 cond_syscall(compat_sys_socketcall);
115 cond_syscall(sys_inotify_init);
116 cond_syscall(sys_inotify_init1);
117 cond_syscall(sys_inotify_add_watch);
118 cond_syscall(sys_inotify_rm_watch);
119 cond_syscall(sys_migrate_pages);
120 cond_syscall(sys_move_pages);
121 cond_syscall(sys_chown16);
122 cond_syscall(sys_fchown16);
123 cond_syscall(sys_getegid16);
124 cond_syscall(sys_geteuid16);
125 cond_syscall(sys_getgid16);
126 cond_syscall(sys_getgroups16);
127 cond_syscall(sys_getresgid16);
128 cond_syscall(sys_getresuid16);
129 cond_syscall(sys_getuid16);
130 cond_syscall(sys_lchown16);
131 cond_syscall(sys_setfsgid16);
132 cond_syscall(sys_setfsuid16);
133 cond_syscall(sys_setgid16);
134 cond_syscall(sys_setgroups16);
135 cond_syscall(sys_setregid16);
136 cond_syscall(sys_setresgid16);
137 cond_syscall(sys_setresuid16);
138 cond_syscall(sys_setreuid16);
139 cond_syscall(sys_setuid16);
140 cond_syscall(sys_sgetmask);
141 cond_syscall(sys_ssetmask);
142 cond_syscall(sys_vm86old);
143 cond_syscall(sys_vm86);
144 cond_syscall(sys_modify_ldt);
145 cond_syscall(sys_ipc);
146 cond_syscall(compat_sys_ipc);
147 cond_syscall(compat_sys_sysctl);
148 cond_syscall(sys_flock);
149 cond_syscall(sys_io_setup);
150 cond_syscall(sys_io_destroy);
151 cond_syscall(sys_io_submit);
152 cond_syscall(sys_io_cancel);
153 cond_syscall(sys_io_getevents);
154 cond_syscall(compat_sys_io_setup);
155 cond_syscall(compat_sys_io_submit);
156 cond_syscall(compat_sys_io_getevents);
157 cond_syscall(sys_sysfs);
158 cond_syscall(sys_syslog);
159 cond_syscall(sys_process_vm_readv);
160 cond_syscall(sys_process_vm_writev);
161 cond_syscall(compat_sys_process_vm_readv);
162 cond_syscall(compat_sys_process_vm_writev);
163 cond_syscall(sys_uselib);
164 cond_syscall(sys_fadvise64);
165 cond_syscall(sys_fadvise64_64);
166 cond_syscall(sys_madvise);
167 cond_syscall(sys_setuid);
168 cond_syscall(sys_setregid);
169 cond_syscall(sys_setgid);
170 cond_syscall(sys_setreuid);
171 cond_syscall(sys_setresuid);
172 cond_syscall(sys_getresuid);
173 cond_syscall(sys_setresgid);
174 cond_syscall(sys_getresgid);
175 cond_syscall(sys_setgroups);
176 cond_syscall(sys_getgroups);
177 cond_syscall(sys_setfsuid);
178 cond_syscall(sys_setfsgid);
179 cond_syscall(sys_capget);
180 cond_syscall(sys_capset);
181 cond_syscall(sys_copy_file_range);
182 
183 /* arch-specific weak syscall entries */
184 cond_syscall(sys_pciconfig_read);
185 cond_syscall(sys_pciconfig_write);
186 cond_syscall(sys_pciconfig_iobase);
187 cond_syscall(compat_sys_s390_ipc);
188 cond_syscall(ppc_rtas);
189 cond_syscall(sys_spu_run);
190 cond_syscall(sys_spu_create);
191 cond_syscall(sys_subpage_prot);
192 cond_syscall(sys_s390_pci_mmio_read);
193 cond_syscall(sys_s390_pci_mmio_write);
194 
195 /* mmu depending weak syscall entries */
196 cond_syscall(sys_mprotect);
197 cond_syscall(sys_msync);
198 cond_syscall(sys_mlock);
199 cond_syscall(sys_munlock);
200 cond_syscall(sys_mlockall);
201 cond_syscall(sys_munlockall);
202 cond_syscall(sys_mlock2);
203 cond_syscall(sys_mincore);
204 cond_syscall(sys_madvise);
205 cond_syscall(sys_mremap);
206 cond_syscall(sys_remap_file_pages);
207 cond_syscall(compat_sys_move_pages);
208 cond_syscall(compat_sys_migrate_pages);
209 
210 /* block-layer dependent */
211 cond_syscall(sys_bdflush);
212 cond_syscall(sys_ioprio_set);
213 cond_syscall(sys_ioprio_get);
214 
215 /* New file descriptors */
216 cond_syscall(sys_signalfd);
217 cond_syscall(sys_signalfd4);
218 cond_syscall(compat_sys_signalfd);
219 cond_syscall(compat_sys_signalfd4);
220 cond_syscall(sys_timerfd_create);
221 cond_syscall(sys_timerfd_settime);
222 cond_syscall(sys_timerfd_gettime);
223 cond_syscall(compat_sys_timerfd_settime);
224 cond_syscall(compat_sys_timerfd_gettime);
225 cond_syscall(sys_eventfd);
226 cond_syscall(sys_eventfd2);
227 cond_syscall(sys_memfd_create);
228 cond_syscall(sys_userfaultfd);
229 
230 /* performance counters: */
231 cond_syscall(sys_perf_event_open);
232 
233 /* fanotify! */
234 cond_syscall(sys_fanotify_init);
235 cond_syscall(sys_fanotify_mark);
236 cond_syscall(compat_sys_fanotify_mark);
237 
238 /* open by handle */
239 cond_syscall(sys_name_to_handle_at);
240 cond_syscall(sys_open_by_handle_at);
241 cond_syscall(compat_sys_open_by_handle_at);
242 
243 /* compare kernel pointers */
244 cond_syscall(sys_kcmp);
245 
246 /* operate on Secure Computing state */
247 cond_syscall(sys_seccomp);
248 
249 /* access BPF programs and maps */
250 cond_syscall(sys_bpf);
251 
252 /* execveat */
253 cond_syscall(sys_execveat);
254 
255 /* membarrier */
256 cond_syscall(sys_membarrier);
257 
258 /* memory protection keys */
259 cond_syscall(sys_pkey_mprotect);
260 cond_syscall(sys_pkey_alloc);
261 cond_syscall(sys_pkey_free);
262