summaryrefslogtreecommitdiffstats
path: root/tapset/i686/syscalls.stp
blob: b47bfea45499f251300f5a727f8fde8743e869ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619

# fstat ______________________________________________________
# long sys_fstat(unsigned int fd,struct __old_kernel_stat __user * statbuf)
probe syscall.fstat = kernel.function("sys_fstat") {
	name = "fstat"
	filedes = $fd
	buf_uaddr = $statbuf
	argstr = sprintf("%d, [0x%x]", filedes, buf_uaddr)
}
probe syscall.fstat.return = kernel.function("sys_fstat").return {
	name = "fstat"
	returnp = 1
}

# getegid16 __________________________________________________
# long sys_getegid16(void)
probe syscall.getegid16 = kernel.function("sys_getegid16") {
	name = "getegid16"
}
probe syscall.getegid16.return = kernel.function("sys_getegid16").return {
	name = "getegid16"
	returnp = 1
}

# geteuid16 __________________________________________________
# long sys_geteuid16(void)
probe syscall.geteuid16 = kernel.function("sys_geteuid16") {
	name = "geteuid16"
}
probe syscall.geteuid16.return = kernel.function("sys_geteuid16").return {
	name = "geteuid16"
	returnp = 1
}

# getgid16 ___________________________________________________
# long sys_getgid16(void)
probe syscall.getgid16 = kernel.function("sys_getgid16") {
	name = "getgid16"
}
probe syscall.getgid16.return = kernel.function("sys_getgid16").return {
	name = "getgid16"
	returnp = 1
}

# getgroups16 ________________________________________________
# long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist)
probe syscall.getgroups16 = kernel.function("sys_getgroups16") {
	name = "getgroups16"
	size = $gidsetsize
	list_uaddr = $grouplist
	argstr = sprintf("%d, [0x%x]", size, list_uaddr)
}
probe syscall.getgroups16.return = kernel.function("sys_getgroups16").return {
	name = "getgroups16"
	returnp = 1
}

# getuid16 ___________________________________________________
# long sys_getuid16(void)
probe syscall.getuid16 = kernel.function("sys_getuid16") {
	name = "getuid16"
}
probe syscall.getuid16.return = kernel.function("sys_getuid16").return {
	name = "getuid16"
	returnp = 1
}

# lstat ______________________________________________________
# long sys_lstat(char __user * filename, struct __old_kernel_stat __user * statbuf)
probe syscall.lstat = kernel.function("sys_lstat") {
	name = "lstat"
	file_name = user_string($filename)
	buf_uaddr = $statbuf
	argstr = sprintf("%s, [0x%x]", file_name, buf_uaddr) 
}
probe syscall.lstat.return = kernel.function("sys_lstat").return {
	name = "lstat.return"
	returnp = 1
}

# mmap2
# long sys_mmap2(unsigned long addr, unsigned long len,
#	unsigned long prot, unsigned long flags,
#	unsigned long fd, unsigned long pgoff)
probe syscall.mmap2 = kernel.function("sys_mmap2") {
	name = "mmap2"
	start = $addr
	length = $len
	prot = $prot
	flags = $flags
	fd = $fd
	pgoffset = $pgoff
	argstr = sprintf("0x%x, %d, %s, %s, %d, 0x%x", start, 
		length, _mprotect_prot_str(prot), _mmap_flags(flags),
		fd, pgoffset)
}
probe syscall.mmap2.return = kernel.function("sys_mmap2").return {
	name = "mmap2"
	returnp = 1
}

# setgroups16 ________________________________________________
#
# asmlinkage long
# sys_setgroups16(int gidsetsize,
#		     old_gid_t __user *grouplist)
#
probe syscall.setgroups16 = kernel.function("sys_setgroups16") {
	name = "setgroups16"
	size = $gidsetsize
	list_uaddr = $grouplist
	argstr = ""
}
probe syscall.setgroups16.return = kernel.function("sys_setgroups16").return {
	name = "setgroups16"
	returnp = 1
}

# stat _______________________________________________________
#
# asmlinkage long
# sys_stat(char __user * filename,
#	    struct __old_stat __user * statbuf)
#
probe syscall.stat = kernel.function("sys_stat") {
	name = "stat"
	filename_uaddr = $filename
	filename = user_string($filename)
	buf_uaddr = $statbuf
	argstr = sprintf("%s, [0x%x]", filename, buf_uaddr)
}
probe syscall.stat.return = kernel.function("sys_stat").return {
	name = "stat"
	returnp = 1
}


# fcntl64 ____________________________________________________
/*
 * asmlinkage long
 * sys_fcntl64(unsigned int fd,
 *             unsigned int cmd,
 *             unsigned long arg)
 */
probe syscall.fcntl64 = kernel.function("sys_fcntl64") {
name = "fcntl64"
	fd = $fd
	cmd = $cmd
	cmd_str = _fcntl_cmd_str($cmd)
	arg = $arg
	argstr = sprintf("%d, %s, 0x%x", $fd, cmd_str, $arg)
}
probe syscall.fcntl64.return = kernel.function("sys_fcntl64").return {
	name = "fcntl64"
	returnp = 1
}
# fstat64 ____________________________________________________
/*
 * asmlinkage long
 * sys_fstat64(unsigned long fd,
 *             struct stat64 __user * statbuf)
 */
probe syscall.fstat64 = kernel.function("sys_fstat64") {
	name = "fstat64"
	fd = $fd
	buf_uaddr = $statbuf
	argstr = sprintf("%d, [0x%x]", $fd, buf_uaddr)
}
probe syscall.fstat64.return = kernel.function("sys_fstat64").return {
	name = "fstat64"
	returnp = 1
}
# get_thread_area ____________________________________________
/*
 * asmlinkage int
 * sys_get_thread_area(struct user_desc __user *u_info)
 */
probe syscall.get_thread_area = kernel.function("sys_get_thread_area") {
	name = "get_thread_area"
	u_info_uaddr = $u_info
	argstr = sprintf("[0x%x]", u_info_uaddr)
}
probe syscall.get_thread_area.return =
	kernel.function("sys_get_thread_area").return {
	name = "get_thread_area"
	returnp = 1
}
# inotify_add_watch __________________________________________
/*
 * asmlinkage long
 * sys_inotify_add_watch(int fd,
 *                       const char __user *path,
 *                       u32 mask)
 */
probe syscall.inotify_add_watch =
	kernel.function("sys_inotify_add_watch") {
	name = "inotify_add_watch"
	fd = $fd
	path_uaddr = $path
	path = user_string($path)
	mask = $mask
	argstr = sprintf("%d, %s, %d", $fd, path, $mask)
}
probe syscall.inotify_add_watch.return =
	kernel.function("sys_inotify_add_watch").return {
	name = "inotify_add_watch"
	returnp = 1
}
# inotify_init _______________________________________________
/*
 * asmlinkage long
 * sys_inotify_init(void)
 *
 */
probe syscall.inotify_init = kernel.function("sys_inotify_init") {
	name = "inotify_init"
}
probe syscall.inotify_init.return =
	kernel.function("sys_inotify_init").return {
	name = "inotify_init"
	returnp = 1
}
# inotify_rm_watch ___________________________________________
/*
 * asmlinkage long
 * sys_inotify_rm_watch(int fd,
 *                      u32 wd)
 */
probe syscall.inotify_rm_watch =
	kernel.function("sys_inotify_rm_watch") {
	name = "inotify_rm_watch"
	fd = $fd
	wd = $wd
	argstr = sprintf("%d, %d", $fd, $wd)
}
probe syscall.inotify_rm_watch.return =
	kernel.function("sys_inotify_rm_watch").return {
	name = "inotify_rm_watch"
	returnp = 1
}
# iopl _______________________________________________________
/*
 * asmlinkage long
 * sys_iopl(unsigned long unused)
 */
probe syscall.iopl = kernel.function("sys_iopl") {
	name = "iopl"
	level = $unused
	argstr = string($unused)
}
probe syscall.iopl.return = kernel.function("sys_iopl").return {
	name = "iopl"
	returnp = 1
}
# ioprio_get _________________________________________________
/*
 * asmlinkage long
 * sys_ioprio_get(int which,
 *                int who)
 */
probe syscall.ioprio_get = kernel.function("sys_ioprio_get") {
	name = "ioprio_get"
	which = $which
	who = $who
	argstr = sprintf("%d, %d", $which, $who)
}
probe syscall.ioprio_get.return =
	kernel.function("sys_ioprio_get").return {
	name = "ioprio_get"
	returnp = 1
}
# ioprio_set _________________________________________________
/*
 * asmlinkage long
 * sys_ioprio_set(int which,
 *                int who,
 *                int ioprio)
 */
probe syscall.ioprio_set = kernel.function("sys_ioprio_set") {
	name = "ioprio_set"
	which = $which
	who = $who
	ioprio = $ioprio
	argstr = sprintf("%d, %d, %d", $which, $who, $ioprio)
}
probe syscall.ioprio_set.return =
	kernel.function("sys_ioprio_set").return {
	name = "ioprio_set"
	returnp = 1
}
# ipc ________________________________________________________
/*
 * asmlinkage int
 * sys_ipc(uint call,
 *         int first,
 *         int second,
 *         int third,
 *         void __user *ptr,
 *         long fifth)
 */
probe syscall.ipc = kernel.function("sys_ipc") {
	name = "ipc"
	call = $call
	first = $first
	second = $second
	third = $third
	ptr_uaddr = $ptr
	fifth = $fifth
	argstr = sprintf("%d, %d, %d, %d, [0x%x], %d", $call, $first,
			$second, $third, ptr_uaddr, $fifth)
}
probe syscall.ipc.return = kernel.function("sys_ipc").return {
	name = "ipc"
	returnp = 1
}
# lstat64 ____________________________________________________
/*
 * asmlinkage long
 * sys_lstat64(char __user * filename,
 *             struct stat64 __user * statbuf)
 */
probe syscall.lstat64 = kernel.function("sys_lstat64") {
	name = "lstat64"
	filename_uaddr = $filename
	filename = user_string($filename)
	buf_uaddr = $statbuf
	argstr = sprintf("%s, [0x%x]", filename, buf_uaddr)
}
probe syscall.lstat64.return =
	kernel.function("sys_lstat64").return {
	name = "lstat64"
	returnp = 1
}
# olduname ___________________________________________________
/*
 * asmlinkage long
 * sys_olduname(struct new_utsname __user * name)
 */
probe syscall.olduname = kernel.function("sys_olduname") {
	name = "olduname"
	name_uaddr = $name
	argstr = sprintf("[0x%x]", name_uaddr)
}
probe syscall.olduname.return = kernel.function("sys_olduname").return {
	name = "olduname"
	returnp = 1
}
# rt_sigreturn _______________________________________________
/*
 * asmlinkage int
 * sys_rt_sigreturn(unsigned long __unused)
 */
probe syscall.rt_sigreturn = kernel.function("sys_rt_sigreturn") {
	name = "rt_sigreturn"
	__unused = $__unused
	argstr = string($__unused)
}
probe syscall.rt_sigreturn.return =
	kernel.function("sys_rt_sigreturn").return {
	name = "rt_sigreturn"
	returnp = 1
}
# sched_setaffinity __________________________________________
/*
 * asmlinkage long
 * sys_sched_setaffinity(pid_t pid,
 *                       unsigned int len,
 *                       unsigned long __user *user_mask_ptr)
 */
probe syscall.sched_setaffinity =
	kernel.function("sys_sched_setaffinity") {
	name = "sched_setaffinity"
	pid = $pid
      /*
       * doesnt like $len on x86_64 ????
       */
	len = $len
	mask_uaddr = $user_mask_ptr
	argstr = sprintf("%d, %d, [0x%x]", $pid, $len, mask_uaddr)
}
probe syscall.sched_setaffinity.return =
	kernel.function("sys_sched_setaffinity").return {
	name = "sched_setaffinity"
	returnp = 1
}
# sched_setparam _____________________________________________
/*
 * asmlinkage long
 * sys_sched_setparam(pid_t pid,
 *                    struct sched_param __user *param)
 */
probe syscall.sched_setparam =
	kernel.function("do_sched_setscheduler") {
	name = "sched_setparam"
	pid = $pid
	p_uaddr = $param
	argstr = sprintf("%d, [0x%x]", $pid, p_uaddr)
}
probe syscall.sched_setparam.return =
	kernel.function("do_sched_setscheduler").return {
	name = "sched_setparam"
	returnp = 1
}
# sched_setscheduler _________________________________________
/*
 * asmlinkage long
 * sys_sched_setscheduler(pid_t pid,
 *                        int policy,
 *                        struct sched_param __user *param)
 */
probe syscall.sched_setscheduler =
	kernel.function("do_sched_setscheduler") {
	name = "sched_setscheduler"
	pid = $pid
	policy = $policy
	policy_str = _sched_policy_str($policy)
	p_uaddr = $param
	argstr = sprintf("%d, %s, [0x%x]", $pid, policy_str, p_uaddr)
}
probe syscall.sched_setscheduler.return =
	kernel.function("do_sched_setscheduler").return {
	name = "sched_setscheduler"
	returnp = 1
}
# set_thread_area ____________________________________________
/*
 * asmlinkage int
 * sys_set_thread_area(struct user_desc __user *u_info)
 */
probe syscall.set_thread_area =
	kernel.function("sys_set_thread_area") {
	name = "set_thread_area"
	u_info_uaddr = $u_info
	argstr = sprintf("[0x%x]", u_info_uaddr)
}
probe syscall.set_thread_area.return =
	kernel.function("sys_set_thread_area").return {
	name = "set_thread_area"
	returnp = 1
}
# set_zone_reclaim ___________________________________________
/*
 * asmlinkage long
 * sys_set_zone_reclaim(unsigned int node,
 *                      unsigned int zone,
 *                      unsigned int state)
 */
%( kernel_v  < "2.6.15" %?
probe syscall.set_zone_reclaim =
	kernel.function("sys_set_zone_reclaim") {
	name = "set_zone_reclaim"
	node = $node
	zone = $zone
	state = $state
	argstr = sprintf("%d, %d, %d", $node, $zone, $state)
}
probe syscall.set_zone_reclaim.return =
	kernel.function("sys_set_zone_reclaim").return {
	name = "set_zone_reclaim"
	returnp = 1
}
%)
# shmat ______________________________________________________
/*
 * asmlinkage long
 * sys_shmat(int shmid,
 *           char __user *shmaddr,
 *           int shmflg)
 */
probe syscall.shmat =
	kernel.function("sys_shmat") {
	name = "shmat"
	shmid = $shmid
	shmaddr_uaddr = $shmaddr
	shmflg = $shmflg
	argstr = sprintf("%d, [0x%x], %d", $shmid, shmaddr_uaddr, $shmflg)
}
probe syscall.shmat.return =
	kernel.function("sys_shmat").return {
	name = "shmat"
	returnp = 1
}
# sigaction __________________________________________________
/*
 * asmlinkage int
 * sys_sigaction(int sig,
 *               const struct old_sigaction __user *act,
 *               struct old_sigaction __user *oact)
 */
probe syscall.sigaction =
	kernel.function("sys_sigaction") {
	name = "sigaction"
	sig = $sig
	act_uaddr = $act
	oact_uaddr = $oact
	argstr = sprintf("%s, [0x%x], [0x%x]", _signal_name($sig),
				act_uaddr, oact_uaddr)
}
probe syscall.sigaction.return =
	kernel.function("sys_sigaction").return {
	name = "sigaction"
	returnp = 1
}
# sigaltstack ________________________________________________
/*
 * asmlinkage int
 * sys_sigaltstack(unsigned long ebx)
 */
probe syscall.sigaltstack =
	kernel.function("sys_sigaltstack") {
	name = "sigaltstack"
	ebx = $ebx
	argstr = sprintf("0x%x", $ebx)
}
probe syscall.sigaltstack.return =
	kernel.function("sys_sigaltstack").return {
	name = "sigaltstack"
	returnp = 1
}
# sigreturn __________________________________________________
/*
 * asmlinkage int
 * sys_sigreturn(unsigned long __unused)
 */
probe syscall.sigreturn =
	kernel.function("sys_sigreturn") {
	name = "sigreturn"
	__unused = $__unused
	argstr = string($__unused)
}
probe syscall.sigreturn.return =
	kernel.function("sys_sigreturn").return {
	name = "sigreturn.return"
}
# sigsuspend _________________________________________________
/*
 * asmlinkage int
 * sys_sigsuspend(int history0,
 *                int history1,
 *                old_sigset_t mask)
 */
probe syscall.sigsuspend =
	kernel.function("sys_sigsuspend") {
	name = "sigsuspend"
	history0 = $history0
	history1 = $history1
	mask = $mask
	argstr = sprintf("%d, %d, 0x%x", $history0, $history1, $mask)
}
probe syscall.sigsuspend.return =
	kernel.function("sys_sigsuspend").return {
	name = "sigsuspend"
	returnp = 1
}
# stat64 _____________________________________________________
/*
 * asmlinkage long
 * sys_stat64(char __user * filename,
 *            struct stat64 __user * statbuf)
 */
probe syscall.stat64 = kernel.function("sys_stat64") {
	name = "stat64"
	filename_uaddr = $filename
	filename = user_string($filename)
	buf_uaddr = $statbuf
	argstr = sprintf("%s, [0x%x]", filename, buf_uaddr)
}
probe syscall.stat64.return = kernel.function("sys_stat64").return {
	name = "stat64"
	returnp = 1
}
# umask ______________________________________________________
/*
 * asmlinkage long
 * sys_umask(int mask)
 */
probe syscall.umask = kernel.function("sys_umask") {
	name = "umask"
	mask = $mask
	argstr = sprintf("%d", $mask)
}
probe syscall.umask.return =
	kernel.function("sys_umask").return {
	name = "umask"
	returnp = 1
}
# vm86 _______________________________________________________
/*
 * asmlinkage int
 * sys_vm86(struct pt_regs regs)
 */
probe syscall.vm86 = kernel.function("sys_vm86") {
	name = "vm86"
      /*
       * unsupported type identifier '$regs'
       * regs = $regs
       */
}
probe syscall.vm86.return = kernel.function("sys_vm86").return {
	name = "vm86"
	returnp = 1
}
# vm86old ____________________________________________________
/*
 * asmlinkage int
 * sys_vm86old(struct pt_regs regs)
 */
probe syscall.vm86old = kernel.function("sys_vm86old") {
	name = "vm86old"
      /*
       * unsupported type identifier '$regs'
       * regs = $regs
       */
}
probe syscall.vm86old.return = kernel.function("sys_vm86old").return {
	name = "vm86old"
	returnp = 1
}