From 507ed33fbf576d99310b16d07ffc58cab120f162 Mon Sep 17 00:00:00 2001 From: Pimyn Girgis Date: Mon, 9 Sep 2024 09:50:36 +0000 Subject: pkg/mgrconfig, prog, sys/linux: add automatic_helper attribute Add automatic_helper attribute and enable it for system calls that are required to properly run automatically generated descriptions. Enable these system calls when descriptions_mode = `Auto`. --- sys/linux/auto-manual.txt | 4 ---- sys/linux/namespaces.txt | 6 +++--- sys/linux/socket.txt | 4 ++-- sys/linux/socket_netlink_generic.txt | 2 +- sys/linux/sys.txt | 4 ++-- 5 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 sys/linux/auto-manual.txt (limited to 'sys') diff --git a/sys/linux/auto-manual.txt b/sys/linux/auto-manual.txt deleted file mode 100644 index 1fd5fa8bd..000000000 --- a/sys/linux/auto-manual.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2024 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. - -socket$auto_nl(domain const[AF_NETLINK], type const[SOCK_RAW], proto const[NETLINK_GENERIC]) sock_nl_generic (automatic) diff --git a/sys/linux/namespaces.txt b/sys/linux/namespaces.txt index 63ded0e2c..52bc768ff 100644 --- a/sys/linux/namespaces.txt +++ b/sys/linux/namespaces.txt @@ -8,13 +8,13 @@ resource fd_namespace[fd] resource fd_userns[fd_namespace] unshare(flags flags[unshare_flags]) -setns(fd fd_namespace, type flags[ns_type]) +setns(fd fd_namespace, type flags[ns_type]) (automatic_helper) -syz_open_procfs$namespace(pid pid, file ptr[in, string[procfs_namespace_file]]) fd_namespace +syz_open_procfs$namespace(pid pid, file ptr[in, string[procfs_namespace_file]]) fd_namespace (automatic_helper) syz_open_procfs$userns(pid pid, file ptr[in, string["ns/user"]]) fd_userns ioctl$NS_GET_USERNS(fd fd_namespace, cmd const[NS_GET_USERNS], arg const[0]) -ioctl$NS_GET_PARENT(fd fd_namespace, cmd const[NS_GET_PARENT], arg const[0]) fd_namespace +ioctl$NS_GET_PARENT(fd fd_namespace, cmd const[NS_GET_PARENT], arg const[0]) fd_namespace (automatic_helper) ioctl$NS_GET_NSTYPE(fd fd_namespace, cmd const[NS_GET_NSTYPE], arg const[0]) ioctl$NS_GET_OWNER_UID(fd fd_namespace, cmd const[NS_GET_OWNER_UID], arg ptr[out, uid]) diff --git a/sys/linux/socket.txt b/sys/linux/socket.txt index e5fbc52c3..e8994fb4e 100644 --- a/sys/linux/socket.txt +++ b/sys/linux/socket.txt @@ -19,7 +19,7 @@ type sock_port int16be[20000:20004] # TODO: describe socketcall syscall -socket(domain flags[socket_domain], type flags[socket_type], proto int32) sock +socket(domain flags[socket_domain], type flags[socket_type], proto int32) sock (automatic_helper) socketpair(domain flags[socket_domain], type flags[socket_type], proto int32, fds ptr[out, sock_pair]) bind(fd sock, addr ptr[in, sockaddr_storage], addrlen len[addr]) connect(fd sock, addr ptr[in, sockaddr_storage], addrlen len[addr]) @@ -283,7 +283,7 @@ ifreq_ioctls = SIOCGIFNAME, SIOCSIFLINK, SIOCGIFFLAGS, SIOCSIFFLAGS, SIOCGIFADDR ioctl$sock_ifreq(fd sock, cmd flags[ifreq_ioctls], arg ptr[inout, ifreq]) -ioctl$sock_SIOCGIFINDEX(fd sock, cmd const[SIOCGIFINDEX], arg ptr[out, ifreq_t[ifindex]]) +ioctl$sock_SIOCGIFINDEX(fd sock, cmd const[SIOCGIFINDEX], arg ptr[out, ifreq_t[ifindex]]) (automatic_helper) ioctl$sock_SIOCGIFBR(fd sock, cmd const[SIOCGIFBR], arg ptr[inout, brctl_arg]) ioctl$sock_SIOCSIFBR(fd sock, cmd const[SIOCSIFBR], arg ptr[inout, brctl_arg]) diff --git a/sys/linux/socket_netlink_generic.txt b/sys/linux/socket_netlink_generic.txt index 2f925733b..a0a83f0f5 100644 --- a/sys/linux/socket_netlink_generic.txt +++ b/sys/linux/socket_netlink_generic.txt @@ -11,7 +11,7 @@ include resource sock_nl_generic[sock_netlink] -socket$nl_generic(domain const[AF_NETLINK], type const[SOCK_RAW], proto const[NETLINK_GENERIC]) sock_nl_generic +socket$nl_generic(domain const[AF_NETLINK], type const[SOCK_RAW], proto const[NETLINK_GENERIC]) sock_nl_generic (automatic_helper) # This is NETLINK_GENERIC created in init_net namespace. Use with extreme care. # It's very dangerous to use as it allows the fuzzer to bring down network connectivity diff --git a/sys/linux/sys.txt b/sys/linux/sys.txt index 7b03e851e..75286af02 100644 --- a/sys/linux/sys.txt +++ b/sys/linux/sys.txt @@ -112,7 +112,7 @@ syz_execute_func(text ptr[in, text[target]]) (disabled) # Exclude /sys/power/state as reported in https://lkml.org/lkml/2021/5/27/653 openat$sysfs(fd const[AT_FDCWD], dir ptr[in, glob["/sys/**/*:-/sys/power/state"]], flags flags[open_flags], mode flags[open_mode]) fd -open(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd +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 @@ -400,7 +400,7 @@ geteuid() uid setpgid(pid pid, pgid pid) getpgid(pid pid) pid getpgrp(pid pid) pid -getpid() pid +getpid() pid (automatic_helper) gettid() pid setreuid(ruid uid, euid uid) setregid(rgid gid, egid gid) -- cgit mrf-deployment