Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/syz-declextract: Code Restructuring #5346

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
653 changes: 345 additions & 308 deletions sys/linux/auto.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sys/linux/auto.txt.const
Original file line number Diff line number Diff line change
Expand Up @@ -3927,7 +3927,7 @@ __NR_munlock = 151, amd64:150, arm64:riscv64:229, mips64le:5147
__NR_munmap = 91, amd64:11, arm64:riscv64:215, mips64le:5011
__NR_name_to_handle_at = 264, 386:341, amd64:303, arm:370, mips64le:5298, ppc64le:345, s390x:335
__NR_nanosleep = 162, amd64:35, arm64:riscv64:101, mips64le:5034
__NR_newfstatat = 79, 386:arm:???, amd64:262, mips64le:5252, ppc64le:291, s390x:293
__NR_newfstatat = 386:arm:arm64:riscv64:???, amd64:262, mips64le:5252, ppc64le:291, s390x:293
__NR_nice = 34, amd64:arm64:mips64le:riscv64:???
__NR_oldfstat = 28, amd64:arm:arm64:mips64le:riscv64:s390x:???
__NR_oldlstat = 84, amd64:arm:arm64:mips64le:riscv64:s390x:???
Expand Down
1 change: 0 additions & 1 deletion sys/linux/socket_ieee802154.txt.const
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ NL802154_ATTR_IFTYPE = 5
NL802154_ATTR_LBT_MODE = 19
NL802154_ATTR_PAGE = 7
NL802154_ATTR_PAN_ID = 9
NL802154_ATTR_PID = 28
NL802154_ATTR_SEC_DEVICE = 46
NL802154_ATTR_SEC_DEVKEY = 47
NL802154_ATTR_SEC_KEY = 48
Expand Down
1 change: 0 additions & 1 deletion sys/linux/socket_netlink_generic_80211.txt.const
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ NL80211_ATTR_MU_MIMO_GROUP_DATA = 231
NL80211_ATTR_NAN_FUNC = 240
NL80211_ATTR_P2P_OPPPS = 163
NL80211_ATTR_PEER_AID = 181
NL80211_ATTR_PID = 82
NL80211_ATTR_PMK = 254
NL80211_ATTR_PMKID = 85
NL80211_ATTR_PMKR0_NAME = 258
Expand Down
1 change: 0 additions & 1 deletion sys/linux/socket_netlink_generic_devlink.txt.const
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ arches = 386, amd64, arm, arm64, mips64le, ppc64le, riscv64, s390x
DEVLINK_ATTR_BUS_NAME = 1
DEVLINK_ATTR_DEV_NAME = 2
DEVLINK_ATTR_NETNS_ID = 140
DEVLINK_ATTR_NETNS_PID = 139
DEVLINK_ATTR_PORT_INDEX = 3
DEVLINK_ATTR_PORT_SPLIT_COUNT = 9
DEVLINK_ATTR_PORT_TYPE = 4
Expand Down
4 changes: 0 additions & 4 deletions sys/linux/socket_netlink_route.txt.const
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ CGW_MOD_DLC = 2
CGW_MOD_ID = 1
CGW_MOD_OR = 2
CGW_MOD_SET = 4
CGW_MOD_UID = 14
CGW_MOD_XOR = 3
CGW_SRC_IF = 9
CGW_TYPE_CAN_CAN = 1
Expand Down Expand Up @@ -222,7 +221,6 @@ IFLA_MACVLAN_MACADDR_MODE = 3
IFLA_MACVLAN_MODE = 1
IFLA_MAP = 14
IFLA_MASTER = 10
IFLA_NET_NS_PID = 19
IFLA_PHYS_PORT_ID = 34
IFLA_PHYS_SWITCH_ID = 36
IFLA_PORT_HOST_UUID = 5
Expand Down Expand Up @@ -353,7 +351,6 @@ NDTA_PARMS = 6
NETLINK_ROUTE = 0
NETNSA_FD = 3
NETNSA_NSID = 1
NETNSA_PID = 2
NEXTHOP_GRP_TYPE_MPATH = 0
NEXTHOP_GRP_TYPE_RES = 1
NHA_ENCAP = 8
Expand Down Expand Up @@ -396,7 +393,6 @@ RTA_NEWDST = 19
RTA_OIF = 4
RTA_PREFSRC = 7
RTA_SRC = 2
RTA_UID = 25
RTA_VIA = 18
RTM_DELADDR = 21
RTM_DELADDRLABEL = 73
Expand Down
26 changes: 13 additions & 13 deletions sys/linux/sys.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ openat$sysfs(fd const[AT_FDCWD], dir ptr[in, glob["/sys/**/*:-/sys/power/state"]

open(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd (automatic_helper)
# Just so that we have something that creates fd_dir resources.
open$dir(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd_dir
openat$dir(fd const[AT_FDCWD], file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd_dir
open$dir(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd_dir (automatic_helper)
openat$dir(fd const[AT_FDCWD], file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd_dir (automatic_helper)
openat(fd fd_dir[opt], file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd
openat2$dir(fd const[AT_FDCWD], file ptr[in, filename], how ptr[in, open_how], size bytesize[how]) fd_dir
openat2$dir(fd const[AT_FDCWD], file ptr[in, filename], how ptr[in, open_how], size bytesize[how]) fd_dir (automatic_helper)
openat2(fd fd_dir[opt], file ptr[in, filename], how ptr[in, open_how], size bytesize[how]) fd
creat(file ptr[in, filename], mode flags[open_mode]) fd
close(fd fd)
Expand Down Expand Up @@ -270,7 +270,7 @@ fcntl$getflags(fd fd, cmd flags[fcntl_getflags])
fcntl$setflags(fd fd, cmd const[F_SETFD], flags flags[fcntl_flags])
fcntl$setstatus(fd fd, cmd const[F_SETFL], flags flags[fcntl_status])
fcntl$lock(fd fd, cmd flags[fcntl_lock], lock ptr[in, flock])
fcntl$getown(fd fd, cmd const[F_GETOWN]) pid
fcntl$getown(fd fd, cmd const[F_GETOWN]) pid (automatic_helper)
fcntl$setown(fd fd, cmd const[F_SETOWN], pid pid)
fcntl$getownex(fd fd, cmd const[F_GETOWN_EX], arg ptr[out, f_owner_ex])
fcntl$setownex(fd fd, cmd const[F_SETOWN_EX], arg ptr[in, f_owner_ex])
Expand Down Expand Up @@ -369,9 +369,9 @@ futimesat(dir fd_dir, pathname ptr[in, filename], times ptr[in, itimerval])
utimensat(dir fd_dir, pathname ptr[in, filename], times ptr[in, itimerval], flags flags[utimensat_flags])

# Small trick - syzkaller cannot give the proper stack pointer to clone(), but we can do it with the aid of pseudo syscalls.
syz_clone(flags flags[clone_flags], stack buffer[in], stack_len bytesize[stack], parentid ptr[out, int32], childtid ptr[out, int32], tls buffer[in]) pid
syz_clone(flags flags[clone_flags], stack buffer[in], stack_len bytesize[stack], parentid ptr[out, int32], childtid ptr[out, int32], tls buffer[in]) pid (automatic_helper)

syz_clone3(args ptr[in, clone_args], size bytesize[args]) pid
syz_clone3(args ptr[in, clone_args], size bytesize[args]) pid (automatic_helper)

# We need these disabled definitions to simplify the presence and the NR checking.
clone(flags flags[clone_flags], sp buffer[in], parentid ptr[out, int32], childtid ptr[out, int32], tls buffer[in]) (breaks_returns, disabled)
Expand All @@ -395,17 +395,17 @@ resource pid[int32]: 0, -1
resource uid[int32]: 0, -1, 0xee00, 0xee01
resource gid[int32]: 0, -1, 0xee00, 0xee01

getgid() gid
getegid() gid
getgid() gid (automatic_helper)
getegid() gid (automatic_helper)
setuid(uid uid)
setgid(gid gid)
getuid() uid
geteuid() uid
getuid() uid (automatic_helper)
geteuid() uid (automatic_helper)
setpgid(pid pid, pgid pid)
getpgid(pid pid) pid
getpgrp(pid pid) pid
getpgid(pid pid) pid (automatic_helper)
getpgrp(pid pid) pid (automatic_helper)
getpid() pid (automatic_helper)
gettid() pid
gettid() pid (automatic_helper)
setreuid(ruid uid, euid uid)
setregid(rgid gid, egid gid)
setresuid(ruid uid, euid uid, suid uid)
Expand Down
2 changes: 1 addition & 1 deletion sys/linux/sys.txt.const
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ __NR_munlockall = 153, amd64:152, arm64:riscv64:231, mips64le:5149
__NR_munmap = 91, amd64:11, arm64:riscv64:215, mips64le:5011
__NR_name_to_handle_at = 264, 386:341, amd64:303, arm:370, mips64le:5298, ppc64le:345, s390x:335
__NR_nanosleep = 162, amd64:35, arm64:riscv64:101, mips64le:5034
__NR_newfstatat = 79, 386:arm:???, amd64:262, mips64le:5252, ppc64le:291, s390x:293
__NR_newfstatat = 386:arm:arm64:riscv64:???, amd64:262, mips64le:5252, ppc64le:291, s390x:293
__NR_open = 5, amd64:2, arm64:riscv64:???, mips64le:5002
__NR_open_by_handle_at = 265, 386:342, amd64:304, arm:371, mips64le:5299, ppc64le:346, s390x:336
__NR_openat = 56, 386:295, amd64:257, arm:322, mips64le:5247, ppc64le:286, s390x:288
Expand Down
Loading
Loading