1 | /* |
2 | * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl> |
3 | * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl> |
4 | * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de> |
5 | * Copyright (c) 1995, 1996 Michael Elizabeth Chastain <mec@duracef.shout.net> |
6 | * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com> |
7 | * Copyright (C) 1998-2001 Wichert Akkerman <wakkerma@deephackmode.org> |
8 | * All rights reserved. |
9 | * |
10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions |
12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. |
15 | * 2. Redistributions in binary form must reproduce the above copyright |
16 | * notice, this list of conditions and the following disclaimer in the |
17 | * documentation and/or other materials provided with the distribution. |
18 | * 3. The name of the author may not be used to endorse or promote products |
19 | * derived from this software without specific prior written permission. |
20 | * |
21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
31 | */ |
32 | // flag bit 7 is set 0, as const char*; |
33 | // flag bit 7 is set 1, as void*, size indicate in next-arg; |
34 | unsigned char syscall_param_flags[] = { |
35 | 0x82, 3, //read=0 |
36 | 0x82, 3, //write=1 |
37 | 1, 3, //open=2 |
38 | 0, 1, //close=3 |
39 | 1, 2, //stat=4 |
40 | 0, 2, //fstat=5 |
41 | 1, 2, //lstat=6 |
42 | 0, 3, //poll=7 |
43 | 0, 3, //lseek=8 |
44 | 0, 6, //mmap=9 |
45 | 0, 3, //mprotect=10 |
46 | 0, 2, //munmap=11 |
47 | 0, 1, //brk=12 |
48 | 0, 4, //rt_sigaction=13 |
49 | 0, 4, //rt_sigprocmask=14 |
50 | 0, 0, //rt_sigreturn=15 |
51 | 0, 3, //ioctl=16 |
52 | 0x82, 4, //pread64=17 |
53 | 0x82, 4, //pwrite64=18 |
54 | 0, 3, //readv=19 |
55 | 0, 3, //writev=20 |
56 | 1, 2, //access=21 |
57 | 0, 1, //pipe=22 |
58 | 0, 5, //select=23 |
59 | 0, 0, //sched_yield=24 |
60 | 0, 5, //mremap=25 |
61 | 0, 3, //msync=26 |
62 | 0, 3, //mincore=27 |
63 | 0, 3, //madvise=28 |
64 | 0, 3, //shmget=29 |
65 | 0, 3, //shmat=30 |
66 | 0, 3, //shmctl=31 |
67 | 0, 1, //dup=32 |
68 | 0, 2, //dup2=33 |
69 | 0, 0, //pause=34 |
70 | 0, 2, //nanosleep=35 |
71 | 0, 2, //getitimer=36 |
72 | 0, 1, //alarm=37 |
73 | 0, 3, //setitimer=38 |
74 | 0, 0, //getpid=39 |
75 | 0, 4, //sendfile=40 |
76 | 0, 3, //socket=41 |
77 | 0, 3, //connect=42 |
78 | 0, 3, //accept=43 |
79 | 0x82, 6, //sendto=44 |
80 | 0x82, 6, //recvfrom=45 |
81 | 0, 3, //sendmsg=46 |
82 | 0, 3, //recvmsg=47 |
83 | 0, 2, //shutdown=48 |
84 | 0, 3, //bind=49 |
85 | 0, 2, //listen=50 |
86 | 0, 3, //getsockname=51 |
87 | 0, 3, //getpeername=52 |
88 | 0, 4, //socketpair=53 |
89 | 0, 5, //setsockopt=54 |
90 | 0, 5, //getsockopt=55 |
91 | 0, 5, //clone=56 |
92 | 0, 0, //fork=57 |
93 | 0, 0, //vfork=58 |
94 | 0, 3, //execve=59 |
95 | 0, 1, //exit=60 |
96 | 0, 4, //wait4=61 |
97 | 0, 2, //kill=62 |
98 | 0, 1, //uname=63 |
99 | 0, 3, //semget=64 |
100 | 0, 3, //semop=65 |
101 | 0, 4, //semctl=66 |
102 | 0, 1, //shmdt=67 |
103 | 0, 2, //msgget=68 |
104 | 0, 4, //msgsnd=69 |
105 | 0, 5, //msgrcv=70 |
106 | 0, 3, //msgctl=71 |
107 | 0, 3, //fcntl=72 |
108 | 0, 2, //flock=73 |
109 | 0, 1, //fsync=74 |
110 | 0, 1, //fdatasync=75 |
111 | 1, 2, //truncate=76 |
112 | 0, 2, //ftruncate=77 |
113 | 0, 3, //getdents=78 |
114 | 0, 2, //getcwd=79 |
115 | 1, 1, //chdir=80 |
116 | 0, 1, //fchdir=81 |
117 | 3, 2, //rename=82 |
118 | 1, 2, //mkdir=83 |
119 | 1, 1, //rmdir=84 |
120 | 1, 2, //creat=85 |
121 | 3, 2, //link=86 |
122 | 1, 1, //unlink=87 |
123 | 3, 2, //symlink=88 |
124 | 1, 3, //readlink=89 |
125 | 1, 2, //chmod=90 |
126 | 0, 2, //fchmod=91 |
127 | 1, 3, //chown=92 |
128 | 0, 3, //fchown=93 |
129 | 1, 3, //lchown=94 |
130 | 0, 1, //umask=95 |
131 | 0, 2, //gettimeofday=96 |
132 | 0, 2, //getrlimit=97 |
133 | 0, 2, //getrusage=98 |
134 | 0, 1, //sysinfo=99 |
135 | 0, 1, //times=100 |
136 | 0, 4, //ptrace=101 |
137 | 0, 0, //getuid=102 |
138 | 0, 3, //syslog=103 |
139 | 0, 0, //getgid=104 |
140 | 0, 1, //setuid=105 |
141 | 0, 1, //setgid=106 |
142 | 0, 0, //geteuid=107 |
143 | 0, 0, //getegid=108 |
144 | 0, 2, //setpgid=109 |
145 | 0, 0, //getppid=110 |
146 | 0, 0, //getpgrp=111 |
147 | 0, 0, //setsid=112 |
148 | 0, 2, //setreuid=113 |
149 | 0, 2, //setregid=114 |
150 | 0, 2, //getgroups=115 |
151 | 0, 2, //setgroups=116 |
152 | 0, 3, //setresuid=117 |
153 | 0, 3, //getresuid=118 |
154 | 0, 3, //setresgid=119 |
155 | 0, 3, //getresgid=120 |
156 | 0, 1, //getpgid=121 |
157 | 0, 1, //setfsuid=122 |
158 | 0, 1, //setfsgid=123 |
159 | 0, 1, //getsid=124 |
160 | 0, 2, //capget=125 |
161 | 0, 2, //capset=126 |
162 | 0, 2, //rt_sigpending=127 |
163 | 0, 4, //rt_sigtimedwait=128 |
164 | 0, 3, //rt_sigqueueinfo=129 |
165 | 0, 2, //rt_sigsuspend=130 |
166 | 0, 2, //sigaltstack=131 |
167 | 1, 2, //utime=132 |
168 | 1, 3, //mknod=133 |
169 | 1, 1, //uselib=134 |
170 | 0, 1, //personality=135 |
171 | 0, 2, //ustat=136 |
172 | 1, 2, //statfs=137 |
173 | 0, 2, //fstatfs=138 |
174 | 0, 3, //sysfs=139 |
175 | 0, 2, //getpriority=140 |
176 | 0, 3, //setpriority=141 |
177 | 0, 2, //sched_setparam=142 |
178 | 0, 2, //sched_getparam=143 |
179 | 0, 3, //sched_setscheduler=144 |
180 | 0, 1, //sched_getscheduler=145 |
181 | 0, 1, //sched_get_priority_max=146 |
182 | 0, 1, //sched_get_priority_min=147 |
183 | 0, 2, //sched_rr_get_interval=148 |
184 | 0, 2, //mlock=149 |
185 | 0, 2, //munlock=150 |
186 | 0, 1, //mlockall=151 |
187 | 0, 0, //munlockall=152 |
188 | 0, 0, //vhangup=153 |
189 | 0, 3, //modify_ldt=154 |
190 | 3, 2, //pivot_root=155 |
191 | 0, 1, //_sysctl=156 |
192 | 0, 5, //prctl=157 |
193 | 0, 2, //arch_prctl=158 |
194 | 0, 1, //adjtimex=159 |
195 | 0, 2, //setrlimit=160 |
196 | 1, 1, //chroot=161 |
197 | 0, 0, //sync=162 |
198 | 1, 1, //acct=163 |
199 | 0, 2, //settimeofday=164 |
200 | 7, 5, //mount=165 |
201 | 1, 2, //umount2=166 |
202 | 1, 2, //swapon=167 |
203 | 1, 1, //swapoff=168 |
204 | 0, 4, //reboot=169 |
205 | 1, 2, //sethostname=170 |
206 | 1, 2, //setdomainname=171 |
207 | 0, 1, //iopl=172 |
208 | 0, 3, //ioperm=173 |
209 | 1, 2, //create_module=174 |
210 | 4, 3, //init_module=175 |
211 | 1, 2, //delete_module=176 |
212 | 0, 1, //get_kernel_syms=177 |
213 | 1, 5, //query_module=178 |
214 | 2, 4, //quotactl=179 |
215 | 0, 3, //nfsservctl=180 |
216 | 0, 5, //getpmsg=181 |
217 | 0, 5, //putpmsg=182 |
218 | 0, 5, //afs_syscall=183 |
219 | 0, 3, //tuxcall=184 |
220 | 0, 3, //security=185 |
221 | 0, 0, //gettid=186 |
222 | 0, 3, //readahead=187 |
223 | 3, 5, //setxattr=188 |
224 | 3, 5, //lsetxattr=189 |
225 | 2, 5, //fsetxattr=190 |
226 | 3, 4, //getxattr=191 |
227 | 3, 4, //lgetxattr=192 |
228 | 2, 4, //fgetxattr=193 |
229 | 1, 3, //listxattr=194 |
230 | 1, 3, //llistxattr=195 |
231 | 0, 3, //flistxattr=196 |
232 | 3, 2, //removexattr=197 |
233 | 3, 2, //lremovexattr=198 |
234 | 2, 2, //fremovexattr=199 |
235 | 0, 2, //tkill=200 |
236 | 0, 1, //time=201 |
237 | 0, 6, //futex=202 |
238 | 0, 3, //sched_setaffinity=203 |
239 | 0, 3, //sched_getaffinity=204 |
240 | 0, 1, //set_thread_area=205 |
241 | 0, 2, //io_setup=206 |
242 | 0, 1, //io_destroy=207 |
243 | 0, 5, //io_getevents=208 |
244 | 0, 3, //io_submit=209 |
245 | 0, 3, //io_cancel=210 |
246 | 0, 1, //get_thread_area=211 |
247 | 0, 3, //lookup_dcookie=212 |
248 | 0, 1, //epoll_create=213 |
249 | 0, 4, //epoll_ctl_old=214 |
250 | 0, 4, //epoll_wait_old=215 |
251 | 0, 5, //remap_file_pages=216 |
252 | 0, 3, //getdents64=217 |
253 | 0, 1, //set_tid_address=218 |
254 | 0, 0, //restart_syscall=219 |
255 | 0, 4, //semtimedop=220 |
256 | 0, 4, //fadvise64=221 |
257 | 0, 3, //timer_create=222 |
258 | 0, 4, //timer_settime=223 |
259 | 0, 2, //timer_gettime=224 |
260 | 0, 1, //timer_getoverrun=225 |
261 | 0, 1, //timer_delete=226 |
262 | 0, 2, //clock_settime=227 |
263 | 0, 2, //clock_gettime=228 |
264 | 0, 2, //clock_getres=229 |
265 | 0, 4, //clock_nanosleep=230 |
266 | 0, 1, //exit_group=231 |
267 | 0, 4, //epoll_wait=232 |
268 | 0, 4, //epoll_ctl=233 |
269 | 0, 3, //tgkill=234 |
270 | 1, 2, //utimes=235 |
271 | 0, 5, //vserver=236 |
272 | 0, 6, //mbind=237 |
273 | 0, 3, //set_mempolicy=238 |
274 | 0, 5, //get_mempolicy=239 |
275 | 1, 4, //mq_open=240 |
276 | 1, 1, //mq_unlink=241 |
277 | 2, 5, //mq_timedsend=242 |
278 | 0, 5, //mq_timedreceive=243 |
279 | 0, 2, //mq_notify=244 |
280 | 0, 3, //mq_getsetattr=245 |
281 | 0, 4, //kexec_load=246 |
282 | 0, 5, //waitid=247 |
283 | 3, 5, //add_key=248 |
284 | 7, 4, //request_key=249 |
285 | 0, 5, //keyctl=250 |
286 | 0, 3, //ioprio_set=251 |
287 | 0, 2, //ioprio_get=252 |
288 | 0, 0, //inotify_init=253 |
289 | 2, 3, //inotify_add_watch=254 |
290 | 0, 2, //inotify_rm_watch=255 |
291 | 0, 4, //migrate_pages=256 |
292 | 2, 4, //openat=257 |
293 | 2, 3, //mkdirat=258 |
294 | 2, 4, //mknodat=259 |
295 | 2, 5, //fchownat=260 |
296 | 2, 3, //futimesat=261 |
297 | 2, 4, //newfstatat=262 |
298 | 2, 3, //unlinkat=263 |
299 | 10, 4, //renameat=264 |
300 | 10, 5, //linkat=265 |
301 | 5, 3, //symlinkat=266 |
302 | 2, 4, //readlinkat=267 |
303 | 2, 4, //fchmodat=268 |
304 | 2, 4, //faccessat=269 |
305 | 0, 6, //pselect6=270 |
306 | 0, 5, //ppoll=271 |
307 | 0, 1, //unshare=272 |
308 | 0, 2, //set_robust_list=273 |
309 | 0, 3, //get_robust_list=274 |
310 | 0, 6, //splice=275 |
311 | 0, 4, //tee=276 |
312 | 0, 4, //sync_file_range=277 |
313 | 0, 4, //vmsplice=278 |
314 | 0, 6, //move_pages=279 |
315 | 2, 4, //utimensat=280 |
316 | 0, 6, //epoll_pwait=281 |
317 | 0, 3, //signalfd=282 |
318 | 0, 2, //timerfd_create=283 |
319 | 0, 1, //eventfd=284 |
320 | 0, 4, //fallocate=285 |
321 | 0, 4, //timerfd_settime=286 |
322 | 0, 2, //timerfd_gettime=287 |
323 | 0, 4, //accept4=288 |
324 | 0, 4, //signalfd4=289 |
325 | 0, 2, //eventfd2=290 |
326 | 0, 1, //epoll_create1=291 |
327 | 0, 3, //dup3=292 |
328 | 0, 2, //pipe2=293 |
329 | 0, 1, //inotify_init1=294 |
330 | 0, 4, //preadv=295 |
331 | 0, 4, //pwritev=296 |
332 | 0, 4, //rt_tgsigqueueinfo=297 |
333 | 0, 5, //perf_event_open=298 |
334 | 0, 5, //recvmmsg=299 |
335 | 0, 2, //fanotify_init=300 |
336 | 16, 5, //fanotify_mark=301 |
337 | 0, 4, //prlimit64=302 |
338 | 2, 5, //name_to_handle_at=303 |
339 | 0, 3, //open_by_handle_at=304 |
340 | 0, 2, //clock_adjtime=305 |
341 | 0, 1, //syncfs=306 |
342 | 0, 4, //sendmmsg=307 |
343 | 0, 2, //setns=308 |
344 | 0, 3, //getcpu=309 |
345 | 0, 6, //process_vm_readv=310 |
346 | 0, 6, //process_vm_writev=311 |
347 | 0, 5, //kcmp=312 |
348 | 2, 3, //finit_module=313 |
349 | 0, 3, //sched_setattr=314 |
350 | 0, 4, //sched_getattr=315 |
351 | 10, 5, //renameat2=316 |
352 | 0, 3, //seccomp=317 |
353 | 0, 3, //getrandom=318 |
354 | 1, 2, //memfd_create=319 |
355 | 8, 5, //kexec_file_load=320 |
356 | 0, 3, //bpf=321 |
357 | 0, 5, //execveat=322 |
358 | 0, 1, //userfaultfd=323 |
359 | 0, 2, //membarrier=324 |
360 | 0, 3, //mlock2=325 |
361 | 0, 6, //copy_file_range=326 |
362 | 0, 6, //preadv2=327 |
363 | 0, 6, //pwritev2=328 |
364 | 0, 4, //pkey_mprotect=329 |
365 | 0, 2, //pkey_alloc=330 |
366 | 0, 1, //pkey_free=331 |
367 | }; |
368 | |