sys_ni.c 7.2 KB

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