Skip to content

Commit

Permalink
sys/linux: move {i,fa}notify into own files
Browse files Browse the repository at this point in the history
  • Loading branch information
dvyukov committed Feb 7, 2019
1 parent d25487b commit cd7a3c2
Show file tree
Hide file tree
Showing 29 changed files with 1,051 additions and 346 deletions.
10 changes: 5 additions & 5 deletions executor/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

#if GOARCH_386
#define GOARCH "386"
#define SYZ_REVISION "8af34e9d497783789dc623e6008be8c98b782a35"
#define SYZ_REVISION "e1337ff46a546061c6a6061490f38ee242f4b072"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
Expand All @@ -70,7 +70,7 @@

#if GOARCH_amd64
#define GOARCH "amd64"
#define SYZ_REVISION "d2efaf232fd23ce4c5158000b4644d50c9375db0"
#define SYZ_REVISION "76561d0a7b6dee60269bef9fedf506e062a2ec19"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
Expand All @@ -80,7 +80,7 @@

#if GOARCH_arm
#define GOARCH "arm"
#define SYZ_REVISION "5dd0744dbc7da7bf396e594b93666959a0dfb8ab"
#define SYZ_REVISION "c4282a5fc9b45f29e7cf834d9201c902a4c33f5a"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
Expand All @@ -90,7 +90,7 @@

#if GOARCH_arm64
#define GOARCH "arm64"
#define SYZ_REVISION "46f6ae162f1fe97659e679e64bb0ee0f86204fa7"
#define SYZ_REVISION "4c5e0d87ff52638dd93a6bbac52c6b6f00954da9"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
Expand All @@ -100,7 +100,7 @@

#if GOARCH_ppc64le
#define GOARCH "ppc64le"
#define SYZ_REVISION "346fc9d6dd8da59799817acda9912b876ce04ccc"
#define SYZ_REVISION "ea43c338e14bea33c0928f245f9524d30f8733bf"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
Expand Down
78 changes: 76 additions & 2 deletions executor/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -3025,6 +3025,16 @@ const call_t syscalls[] = {
{"mq_timedsend", 279},
{"mq_unlink", 278},
{"mremap", 163},
{"msgctl$IPC_INFO", 402},
{"msgctl$IPC_RMID", 402},
{"msgctl$IPC_SET", 402},
{"msgctl$IPC_STAT", 402},
{"msgctl$MSG_INFO", 402},
{"msgctl$MSG_STAT", 402},
{"msgget", 399},
{"msgget$private", 399},
{"msgrcv", 401},
{"msgsnd", 400},
{"msync", 144},
{"munlock", 151},
{"munlockall", 153},
Expand Down Expand Up @@ -3286,6 +3296,21 @@ const call_t syscalls[] = {
{"sched_yield", 158},
{"seccomp", 354},
{"select", 82},
{"semctl$GETALL", 394},
{"semctl$GETNCNT", 394},
{"semctl$GETPID", 394},
{"semctl$GETVAL", 394},
{"semctl$GETZCNT", 394},
{"semctl$IPC_INFO", 394},
{"semctl$IPC_RMID", 394},
{"semctl$IPC_SET", 394},
{"semctl$IPC_STAT", 394},
{"semctl$SEM_INFO", 394},
{"semctl$SEM_STAT", 394},
{"semctl$SETALL", 394},
{"semctl$SETVAL", 394},
{"semget", 393},
{"semget$private", 393},
{"sendfile", 187},
{"sendfile64", 239},
{"sendmmsg", 345},
Expand Down Expand Up @@ -3697,6 +3722,18 @@ const call_t syscalls[] = {
{"setxattr$trusted_overlay_origin", 226},
{"setxattr$trusted_overlay_redirect", 226},
{"setxattr$trusted_overlay_upper", 226},
{"shmat", 397},
{"shmctl$IPC_INFO", 396},
{"shmctl$IPC_RMID", 396},
{"shmctl$IPC_SET", 396},
{"shmctl$IPC_STAT", 396},
{"shmctl$SHM_INFO", 396},
{"shmctl$SHM_LOCK", 396},
{"shmctl$SHM_STAT", 396},
{"shmctl$SHM_UNLOCK", 396},
{"shmdt", 398},
{"shmget", 395},
{"shmget$private", 395},
{"shutdown", 373},
{"sigaltstack", 186},
{"signalfd", 321},
Expand Down Expand Up @@ -7310,7 +7347,6 @@ const call_t syscalls[] = {
{"ioctl$IMGETVERSION", 54},
{"ioctl$IMHOLD_L1", 54},
{"ioctl$IMSETDEVNAME", 54},
{"ioctl$INOTIFY_IOC_SETNEXTWD", 54},
{"ioctl$IOC_PR_CLEAR", 54},
{"ioctl$IOC_PR_PREEMPT", 54},
{"ioctl$IOC_PR_PREEMPT_ABORT", 54},
Expand Down Expand Up @@ -8054,6 +8090,7 @@ const call_t syscalls[] = {
{"mbind", 319},
{"membarrier", 389},
{"memfd_create", 385},
{"migrate_pages", 400},
{"mincore", 219},
{"mkdir", 39},
{"mkdirat", 323},
Expand Down Expand Up @@ -12333,7 +12370,6 @@ const call_t syscalls[] = {
{"ioctl$IMGETVERSION", 54},
{"ioctl$IMHOLD_L1", 54},
{"ioctl$IMSETDEVNAME", 54},
{"ioctl$INOTIFY_IOC_SETNEXTWD", 54},
{"ioctl$IOC_PR_CLEAR", 54},
{"ioctl$IOC_PR_PREEMPT", 54},
{"ioctl$IOC_PR_PREEMPT_ABORT", 54},
Expand Down Expand Up @@ -13005,6 +13041,16 @@ const call_t syscalls[] = {
{"mq_timedsend", 264},
{"mq_unlink", 263},
{"mremap", 163},
{"msgctl$IPC_INFO", 402},
{"msgctl$IPC_RMID", 402},
{"msgctl$IPC_SET", 402},
{"msgctl$IPC_STAT", 402},
{"msgctl$MSG_INFO", 402},
{"msgctl$MSG_STAT", 402},
{"msgget", 399},
{"msgget$private", 399},
{"msgrcv", 401},
{"msgsnd", 400},
{"msync", 144},
{"munlock", 151},
{"munlockall", 153},
Expand Down Expand Up @@ -13266,6 +13312,22 @@ const call_t syscalls[] = {
{"sched_yield", 158},
{"seccomp", 358},
{"select", 82},
{"semctl$GETALL", 394},
{"semctl$GETNCNT", 394},
{"semctl$GETPID", 394},
{"semctl$GETVAL", 394},
{"semctl$GETZCNT", 394},
{"semctl$IPC_INFO", 394},
{"semctl$IPC_RMID", 394},
{"semctl$IPC_SET", 394},
{"semctl$IPC_STAT", 394},
{"semctl$SEM_INFO", 394},
{"semctl$SEM_STAT", 394},
{"semctl$SETALL", 394},
{"semctl$SETVAL", 394},
{"semget", 393},
{"semget$private", 393},
{"semtimedop", 392},
{"sendfile", 186},
{"sendmmsg", 349},
{"sendmmsg$alg", 349},
Expand Down Expand Up @@ -13675,6 +13737,18 @@ const call_t syscalls[] = {
{"setxattr$trusted_overlay_origin", 209},
{"setxattr$trusted_overlay_redirect", 209},
{"setxattr$trusted_overlay_upper", 209},
{"shmat", 397},
{"shmctl$IPC_INFO", 396},
{"shmctl$IPC_RMID", 396},
{"shmctl$IPC_SET", 396},
{"shmctl$IPC_STAT", 396},
{"shmctl$SHM_INFO", 396},
{"shmctl$SHM_LOCK", 396},
{"shmctl$SHM_STAT", 396},
{"shmctl$SHM_UNLOCK", 396},
{"shmdt", 398},
{"shmget", 395},
{"shmget$private", 395},
{"shutdown", 338},
{"sigaltstack", 185},
{"signalfd", 305},
Expand Down
16 changes: 16 additions & 0 deletions sys/linux/fanotify.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2015 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

include <linux/fcntl.h>
include <linux/fanotify.h>

resource fd_fanotify[fd]

fanotify_init(flags flags[fanotify_flags], events flags[fanotify_events]) fd_fanotify
fanotify_mark(fd fd_fanotify, flags flags[fanotify_mark], mask flags[fanotify_mask], fddir fd_dir, path ptr[in, filename])

fanotify_flags = FAN_CLASS_PRE_CONTENT, FAN_CLASS_CONTENT, FAN_CLASS_NOTIF, FAN_CLOEXEC, FAN_NONBLOCK, FAN_UNLIMITED_QUEUE, FAN_UNLIMITED_MARKS, FAN_ENABLE_AUDIT
fanotify_events = O_RDONLY, O_WRONLY, O_RDWR, O_LARGEFILE, O_CLOEXEC, O_APPEND, O_DSYNC, O_NOATIME, O_NONBLOCK, O_SYNC
fanotify_mark = FAN_MARK_ADD, FAN_MARK_REMOVE, FAN_MARK_FLUSH, FAN_MARK_DONT_FOLLOW, FAN_MARK_ONLYDIR, FAN_MARK_MOUNT, FAN_MARK_IGNORED_MASK, FAN_MARK_IGNORED_SURV_MODIFY
fanotify_mask = FAN_ACCESS, FAN_MODIFY, FAN_CLOSE_WRITE, FAN_CLOSE_NOWRITE, FAN_OPEN, FAN_OPEN_EXEC, FAN_ONDIR, FAN_EVENT_ON_CHILD
_ = FAN_OPEN_PERM, FAN_ACCESS_PERM, FAN_OPEN_EXEC_PERM
40 changes: 40 additions & 0 deletions sys/linux/fanotify_386.const
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# AUTOGENERATED FILE
FAN_ACCESS = 1
FAN_ACCESS_PERM = 131072
FAN_CLASS_CONTENT = 4
FAN_CLASS_NOTIF = 0
FAN_CLASS_PRE_CONTENT = 8
FAN_CLOEXEC = 1
FAN_CLOSE_NOWRITE = 16
FAN_CLOSE_WRITE = 8
FAN_ENABLE_AUDIT = 64
FAN_EVENT_ON_CHILD = 134217728
FAN_MARK_ADD = 1
FAN_MARK_DONT_FOLLOW = 4
FAN_MARK_FLUSH = 128
FAN_MARK_IGNORED_MASK = 32
FAN_MARK_IGNORED_SURV_MODIFY = 64
FAN_MARK_MOUNT = 16
FAN_MARK_ONLYDIR = 8
FAN_MARK_REMOVE = 2
FAN_MODIFY = 2
FAN_NONBLOCK = 2
FAN_ONDIR = 1073741824
FAN_OPEN = 32
FAN_OPEN_EXEC = 4096
FAN_OPEN_EXEC_PERM = 262144
FAN_OPEN_PERM = 65536
FAN_UNLIMITED_MARKS = 32
FAN_UNLIMITED_QUEUE = 16
O_APPEND = 1024
O_CLOEXEC = 524288
O_DSYNC = 4096
O_LARGEFILE = 32768
O_NOATIME = 262144
O_NONBLOCK = 2048
O_RDONLY = 0
O_RDWR = 2
O_SYNC = 1052672
O_WRONLY = 1
__NR_fanotify_init = 338
__NR_fanotify_mark = 339
40 changes: 40 additions & 0 deletions sys/linux/fanotify_amd64.const
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# AUTOGENERATED FILE
FAN_ACCESS = 1
FAN_ACCESS_PERM = 131072
FAN_CLASS_CONTENT = 4
FAN_CLASS_NOTIF = 0
FAN_CLASS_PRE_CONTENT = 8
FAN_CLOEXEC = 1
FAN_CLOSE_NOWRITE = 16
FAN_CLOSE_WRITE = 8
FAN_ENABLE_AUDIT = 64
FAN_EVENT_ON_CHILD = 134217728
FAN_MARK_ADD = 1
FAN_MARK_DONT_FOLLOW = 4
FAN_MARK_FLUSH = 128
FAN_MARK_IGNORED_MASK = 32
FAN_MARK_IGNORED_SURV_MODIFY = 64
FAN_MARK_MOUNT = 16
FAN_MARK_ONLYDIR = 8
FAN_MARK_REMOVE = 2
FAN_MODIFY = 2
FAN_NONBLOCK = 2
FAN_ONDIR = 1073741824
FAN_OPEN = 32
FAN_OPEN_EXEC = 4096
FAN_OPEN_EXEC_PERM = 262144
FAN_OPEN_PERM = 65536
FAN_UNLIMITED_MARKS = 32
FAN_UNLIMITED_QUEUE = 16
O_APPEND = 1024
O_CLOEXEC = 524288
O_DSYNC = 4096
O_LARGEFILE = 32768
O_NOATIME = 262144
O_NONBLOCK = 2048
O_RDONLY = 0
O_RDWR = 2
O_SYNC = 1052672
O_WRONLY = 1
__NR_fanotify_init = 300
__NR_fanotify_mark = 301
40 changes: 40 additions & 0 deletions sys/linux/fanotify_arm.const
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# AUTOGENERATED FILE
FAN_ACCESS = 1
FAN_ACCESS_PERM = 131072
FAN_CLASS_CONTENT = 4
FAN_CLASS_NOTIF = 0
FAN_CLASS_PRE_CONTENT = 8
FAN_CLOEXEC = 1
FAN_CLOSE_NOWRITE = 16
FAN_CLOSE_WRITE = 8
FAN_ENABLE_AUDIT = 64
FAN_EVENT_ON_CHILD = 134217728
FAN_MARK_ADD = 1
FAN_MARK_DONT_FOLLOW = 4
FAN_MARK_FLUSH = 128
FAN_MARK_IGNORED_MASK = 32
FAN_MARK_IGNORED_SURV_MODIFY = 64
FAN_MARK_MOUNT = 16
FAN_MARK_ONLYDIR = 8
FAN_MARK_REMOVE = 2
FAN_MODIFY = 2
FAN_NONBLOCK = 2
FAN_ONDIR = 1073741824
FAN_OPEN = 32
FAN_OPEN_EXEC = 4096
FAN_OPEN_EXEC_PERM = 262144
FAN_OPEN_PERM = 65536
FAN_UNLIMITED_MARKS = 32
FAN_UNLIMITED_QUEUE = 16
O_APPEND = 1024
O_CLOEXEC = 524288
O_DSYNC = 4096
O_LARGEFILE = 131072
O_NOATIME = 262144
O_NONBLOCK = 2048
O_RDONLY = 0
O_RDWR = 2
O_SYNC = 1052672
O_WRONLY = 1
__NR_fanotify_init = 367
__NR_fanotify_mark = 368
40 changes: 40 additions & 0 deletions sys/linux/fanotify_arm64.const
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# AUTOGENERATED FILE
FAN_ACCESS = 1
FAN_ACCESS_PERM = 131072
FAN_CLASS_CONTENT = 4
FAN_CLASS_NOTIF = 0
FAN_CLASS_PRE_CONTENT = 8
FAN_CLOEXEC = 1
FAN_CLOSE_NOWRITE = 16
FAN_CLOSE_WRITE = 8
FAN_ENABLE_AUDIT = 64
FAN_EVENT_ON_CHILD = 134217728
FAN_MARK_ADD = 1
FAN_MARK_DONT_FOLLOW = 4
FAN_MARK_FLUSH = 128
FAN_MARK_IGNORED_MASK = 32
FAN_MARK_IGNORED_SURV_MODIFY = 64
FAN_MARK_MOUNT = 16
FAN_MARK_ONLYDIR = 8
FAN_MARK_REMOVE = 2
FAN_MODIFY = 2
FAN_NONBLOCK = 2
FAN_ONDIR = 1073741824
FAN_OPEN = 32
FAN_OPEN_EXEC = 4096
FAN_OPEN_EXEC_PERM = 262144
FAN_OPEN_PERM = 65536
FAN_UNLIMITED_MARKS = 32
FAN_UNLIMITED_QUEUE = 16
O_APPEND = 1024
O_CLOEXEC = 524288
O_DSYNC = 4096
O_LARGEFILE = 131072
O_NOATIME = 262144
O_NONBLOCK = 2048
O_RDONLY = 0
O_RDWR = 2
O_SYNC = 1052672
O_WRONLY = 1
__NR_fanotify_init = 262
__NR_fanotify_mark = 263
Loading

0 comments on commit cd7a3c2

Please sign in to comment.