@@ -1506,26 +1506,26 @@ static void initialize_netdevices(void)
15061506 const char * type ;
15071507 const char * dev ;
15081508 } devtypes [] = {
1509- // Note: ip6erspan device can't be added if ip6gretap exists in the same namespace.
1510- {"ip6gretap" , "ip6gretap0" },
1511- {"bridge" , "bridge0" },
1512- {"vcan" , "vcan0" },
1513- {"bond" , "bond0" },
1514- {"team" , "team0" },
1515- {"dummy" , "dummy0" },
1509+ // Note: ip6erspan device can't be added if ip6gretap exists in the same namespace.
1510+ {"ip6gretap" , "ip6gretap0" },
1511+ {"bridge" , "bridge0" },
1512+ {"vcan" , "vcan0" },
1513+ {"bond" , "bond0" },
1514+ {"team" , "team0" },
1515+ {"dummy" , "dummy0" },
15161516#if SYZ_EXECUTOR || SYZ_NIC_VF
1517- {"nicvf" , "nicvf0" },
1518- #endif
1519- {"nlmon" , "nlmon0" },
1520- {"caif" , "caif0" },
1521- {"batadv" , "batadv0" },
1522- // Note: this adds vxcan0/vxcan1 pair, similar to veth (creating vxcan0 would fail).
1523- {"vxcan" , "vxcan1" },
1524- // This adds connected veth0 and veth1 devices.
1525- {"veth" , 0 },
1526- {"wireguard" , "wg0" },
1527- {"wireguard" , "wg1" },
1528- {"wireguard" , "wg2" },
1517+ {"nicvf" , "nicvf0" },
1518+ #endif
1519+ {"nlmon" , "nlmon0" },
1520+ {"caif" , "caif0" },
1521+ {"batadv" , "batadv0" },
1522+ // Note: this adds vxcan0/vxcan1 pair, similar to veth (creating vxcan0 would fail).
1523+ {"vxcan" , "vxcan1" },
1524+ // This adds connected veth0 and veth1 devices.
1525+ {"veth" , 0 },
1526+ {"wireguard" , "wg0" },
1527+ {"wireguard" , "wg1" },
1528+ {"wireguard" , "wg2" },
15291529 };
15301530 const char * devmasters [] = {"bridge" , "bond" , "team" , "batadv" };
15311531 // If you extend this array, also update netdev_addr_id in vnet.txt
@@ -1535,67 +1535,67 @@ static void initialize_netdevices(void)
15351535 int macsize ;
15361536 bool noipv6 ;
15371537 } devices [] = {
1538- {"lo" , ETH_ALEN },
1539- {"sit0" , 0 },
1540- {"bridge0" , ETH_ALEN },
1541- {"vcan0" , 0 , true},
1542- {"tunl0" , 0 },
1543- {"gre0" , 0 },
1544- {"gretap0" , ETH_ALEN },
1545- {"ip_vti0" , 0 },
1546- {"ip6_vti0" , 0 },
1547- {"ip6tnl0" , 0 },
1548- {"ip6gre0" , 0 },
1549- {"ip6gretap0" , ETH_ALEN },
1550- {"erspan0" , ETH_ALEN },
1551- {"bond0" , ETH_ALEN },
1552- {"veth0" , ETH_ALEN },
1553- {"veth1" , ETH_ALEN },
1554- {"team0" , ETH_ALEN },
1555- {"veth0_to_bridge" , ETH_ALEN },
1556- {"veth1_to_bridge" , ETH_ALEN },
1557- {"veth0_to_bond" , ETH_ALEN },
1558- {"veth1_to_bond" , ETH_ALEN },
1559- {"veth0_to_team" , ETH_ALEN },
1560- {"veth1_to_team" , ETH_ALEN },
1561- {"veth0_to_hsr" , ETH_ALEN },
1562- {"veth1_to_hsr" , ETH_ALEN },
1563- {"hsr0" , 0 },
1564- {"dummy0" , ETH_ALEN },
1538+ {"lo" , ETH_ALEN },
1539+ {"sit0" , 0 },
1540+ {"bridge0" , ETH_ALEN },
1541+ {"vcan0" , 0 , true},
1542+ {"tunl0" , 0 },
1543+ {"gre0" , 0 },
1544+ {"gretap0" , ETH_ALEN },
1545+ {"ip_vti0" , 0 },
1546+ {"ip6_vti0" , 0 },
1547+ {"ip6tnl0" , 0 },
1548+ {"ip6gre0" , 0 },
1549+ {"ip6gretap0" , ETH_ALEN },
1550+ {"erspan0" , ETH_ALEN },
1551+ {"bond0" , ETH_ALEN },
1552+ {"veth0" , ETH_ALEN },
1553+ {"veth1" , ETH_ALEN },
1554+ {"team0" , ETH_ALEN },
1555+ {"veth0_to_bridge" , ETH_ALEN },
1556+ {"veth1_to_bridge" , ETH_ALEN },
1557+ {"veth0_to_bond" , ETH_ALEN },
1558+ {"veth1_to_bond" , ETH_ALEN },
1559+ {"veth0_to_team" , ETH_ALEN },
1560+ {"veth1_to_team" , ETH_ALEN },
1561+ {"veth0_to_hsr" , ETH_ALEN },
1562+ {"veth1_to_hsr" , ETH_ALEN },
1563+ {"hsr0" , 0 },
1564+ {"dummy0" , ETH_ALEN },
15651565#if SYZ_EXECUTOR || SYZ_NIC_VF
1566- {"nicvf0" , 0 , true},
1567- #endif
1568- {"nlmon0" , 0 },
1569- {"vxcan0" , 0 , true},
1570- {"vxcan1" , 0 , true},
1571- {"caif0" , ETH_ALEN }, // TODO: up'ing caif fails with ENODEV
1572- {"batadv0" , ETH_ALEN },
1573- {netdevsim , ETH_ALEN },
1574- {"xfrm0" , ETH_ALEN },
1575- {"veth0_virt_wifi" , ETH_ALEN },
1576- {"veth1_virt_wifi" , ETH_ALEN },
1577- {"virt_wifi0" , ETH_ALEN },
1578- {"veth0_vlan" , ETH_ALEN },
1579- {"veth1_vlan" , ETH_ALEN },
1580- {"vlan0" , ETH_ALEN },
1581- {"vlan1" , ETH_ALEN },
1582- {"macvlan0" , ETH_ALEN },
1583- {"macvlan1" , ETH_ALEN },
1584- {"ipvlan0" , ETH_ALEN },
1585- {"ipvlan1" , ETH_ALEN },
1586- {"veth0_macvtap" , ETH_ALEN },
1587- {"veth1_macvtap" , ETH_ALEN },
1588- {"macvtap0" , ETH_ALEN },
1589- {"macsec0" , ETH_ALEN },
1590- {"veth0_to_batadv" , ETH_ALEN },
1591- {"veth1_to_batadv" , ETH_ALEN },
1592- {"batadv_slave_0" , ETH_ALEN },
1593- {"batadv_slave_1" , ETH_ALEN },
1594- {"geneve0" , ETH_ALEN },
1595- {"geneve1" , ETH_ALEN },
1596- {"wg0" , 0 },
1597- {"wg1" , 0 },
1598- {"wg2" , 0 },
1566+ {"nicvf0" , 0 , true},
1567+ #endif
1568+ {"nlmon0" , 0 },
1569+ {"vxcan0" , 0 , true},
1570+ {"vxcan1" , 0 , true},
1571+ {"caif0" , ETH_ALEN }, // TODO: up'ing caif fails with ENODEV
1572+ {"batadv0" , ETH_ALEN },
1573+ {netdevsim , ETH_ALEN },
1574+ {"xfrm0" , ETH_ALEN },
1575+ {"veth0_virt_wifi" , ETH_ALEN },
1576+ {"veth1_virt_wifi" , ETH_ALEN },
1577+ {"virt_wifi0" , ETH_ALEN },
1578+ {"veth0_vlan" , ETH_ALEN },
1579+ {"veth1_vlan" , ETH_ALEN },
1580+ {"vlan0" , ETH_ALEN },
1581+ {"vlan1" , ETH_ALEN },
1582+ {"macvlan0" , ETH_ALEN },
1583+ {"macvlan1" , ETH_ALEN },
1584+ {"ipvlan0" , ETH_ALEN },
1585+ {"ipvlan1" , ETH_ALEN },
1586+ {"veth0_macvtap" , ETH_ALEN },
1587+ {"veth1_macvtap" , ETH_ALEN },
1588+ {"macvtap0" , ETH_ALEN },
1589+ {"macsec0" , ETH_ALEN },
1590+ {"veth0_to_batadv" , ETH_ALEN },
1591+ {"veth1_to_batadv" , ETH_ALEN },
1592+ {"batadv_slave_0" , ETH_ALEN },
1593+ {"batadv_slave_1" , ETH_ALEN },
1594+ {"geneve0" , ETH_ALEN },
1595+ {"geneve1" , ETH_ALEN },
1596+ {"wg0" , 0 },
1597+ {"wg1" , 0 },
1598+ {"wg2" , 0 },
15991599 };
16001600 int sock = socket (AF_NETLINK , SOCK_RAW , NETLINK_ROUTE );
16011601 if (sock == -1 )
@@ -2100,7 +2100,7 @@ struct btf_header {
21002100};
21012101
21022102#define BTF_INFO_KIND (info ) (((info) >> 24) & 0x0f)
2103- #define BTF_INFO_VLEN (info ) ((info)& 0xffff)
2103+ #define BTF_INFO_VLEN (info ) ((info) & 0xffff)
21042104
21052105#define BTF_KIND_INT 1
21062106#define BTF_KIND_ARRAY 3
@@ -5114,41 +5114,41 @@ static void setup_sysctl()
51145114 const char * data ;
51155115 } files [] = {
51165116#if GOARCH_amd64 || GOARCH_386
5117- // nmi_check_duration() prints "INFO: NMI handler took too long" on slow debug kernels.
5118- // It happens a lot in qemu, and the messages are frequently corrupted
5119- // (intermixed with other kernel output as they are printed from NMI)
5120- // and are not matched against the suppression in pkg/report.
5121- // This write prevents these messages from being printed.
5122- {"/sys/kernel/debug/x86/nmi_longest_ns" , "10000000000" },
5123- #endif
5124- {"/proc/sys/kernel/hung_task_check_interval_secs" , "20" },
5125- // bpf_jit_kallsyms and disabling bpf_jit_harden are required
5126- // for unwinding through bpf functions.
5127- {"/proc/sys/net/core/bpf_jit_kallsyms" , "1" },
5128- {"/proc/sys/net/core/bpf_jit_harden" , "0" },
5129- // This is to provide more useful info in crash reports.
5130- {"/proc/sys/kernel/kptr_restrict" , "0" },
5131- {"/proc/sys/kernel/softlockup_all_cpu_backtrace" , "1" },
5132- // This is to restrict effects of recursive exponential mounts, for details see
5133- // "mnt: Add a per mount namespace limit on the number of mounts" commit.
5134- {"/proc/sys/fs/mount-max" , "100" },
5135- // Dumping all tasks to console can take too long.
5136- {"/proc/sys/vm/oom_dump_tasks" , "0" },
5137- // Executor hits lots of SIGSEGVs, no point in logging them.
5138- {"/proc/sys/debug/exception-trace" , "0" },
5139- {"/proc/sys/kernel/printk" , "7 4 1 3" },
5140- // Faster gc (1 second) is intended to make tests more repeatable.
5141- {"/proc/sys/kernel/keys/gc_delay" , "1" },
5142- // We always want to prefer killing the allocating test process rather than somebody else
5143- // (sshd or another random test process).
5144- {"/proc/sys/vm/oom_kill_allocating_task" , "1" },
5145- // This blocks some of the ways the fuzzer can trigger a reboot.
5146- // ctrl-alt-del=0 tells kernel to signal cad_pid instead of rebooting.
5147- // We set cad_pid to a transient process pid ctrl-alt-del a no-op.
5148- // Note: we need to write a live process pid.
5149- // For context see: https://groups.google.com/g/syzkaller-bugs/c/WqOY4TiRnFg/m/6P9u8lWZAQAJ
5150- {"/proc/sys/kernel/ctrl-alt-del" , "0" },
5151- {"/proc/sys/kernel/cad_pid" , tmppid },
5117+ // nmi_check_duration() prints "INFO: NMI handler took too long" on slow debug kernels.
5118+ // It happens a lot in qemu, and the messages are frequently corrupted
5119+ // (intermixed with other kernel output as they are printed from NMI)
5120+ // and are not matched against the suppression in pkg/report.
5121+ // This write prevents these messages from being printed.
5122+ {"/sys/kernel/debug/x86/nmi_longest_ns" , "10000000000" },
5123+ #endif
5124+ {"/proc/sys/kernel/hung_task_check_interval_secs" , "20" },
5125+ // bpf_jit_kallsyms and disabling bpf_jit_harden are required
5126+ // for unwinding through bpf functions.
5127+ {"/proc/sys/net/core/bpf_jit_kallsyms" , "1" },
5128+ {"/proc/sys/net/core/bpf_jit_harden" , "0" },
5129+ // This is to provide more useful info in crash reports.
5130+ {"/proc/sys/kernel/kptr_restrict" , "0" },
5131+ {"/proc/sys/kernel/softlockup_all_cpu_backtrace" , "1" },
5132+ // This is to restrict effects of recursive exponential mounts, for details see
5133+ // "mnt: Add a per mount namespace limit on the number of mounts" commit.
5134+ {"/proc/sys/fs/mount-max" , "100" },
5135+ // Dumping all tasks to console can take too long.
5136+ {"/proc/sys/vm/oom_dump_tasks" , "0" },
5137+ // Executor hits lots of SIGSEGVs, no point in logging them.
5138+ {"/proc/sys/debug/exception-trace" , "0" },
5139+ {"/proc/sys/kernel/printk" , "7 4 1 3" },
5140+ // Faster gc (1 second) is intended to make tests more repeatable.
5141+ {"/proc/sys/kernel/keys/gc_delay" , "1" },
5142+ // We always want to prefer killing the allocating test process rather than somebody else
5143+ // (sshd or another random test process).
5144+ {"/proc/sys/vm/oom_kill_allocating_task" , "1" },
5145+ // This blocks some of the ways the fuzzer can trigger a reboot.
5146+ // ctrl-alt-del=0 tells kernel to signal cad_pid instead of rebooting.
5147+ // We set cad_pid to a transient process pid ctrl-alt-del a no-op.
5148+ // Note: we need to write a live process pid.
5149+ // For context see: https://groups.google.com/g/syzkaller-bugs/c/WqOY4TiRnFg/m/6P9u8lWZAQAJ
5150+ {"/proc/sys/kernel/ctrl-alt-del" , "0" },
5151+ {"/proc/sys/kernel/cad_pid" , tmppid },
51525152
51535153 };
51545154 for (size_t i = 0 ; i < sizeof (files ) / sizeof (files [0 ]); i ++ ) {
@@ -5297,6 +5297,9 @@ enum fuse_opcode {
52975297 FUSE_COPY_FILE_RANGE = 47 ,
52985298 FUSE_SETUPMAPPING = 48 ,
52995299 FUSE_REMOVEMAPPING = 49 ,
5300+ FUSE_SYNCFS = 50 ,
5301+ FUSE_TMPFILE = 51 ,
5302+ FUSE_STATX = 52 ,
53005303
53015304 // CUSE specific operations
53025305 CUSE_INIT = 4096 ,
@@ -5348,6 +5351,7 @@ struct syz_fuse_req_out {
53485351 struct fuse_out_header * direntplus ;
53495352 struct fuse_out_header * create_open ;
53505353 struct fuse_out_header * ioctl ;
5354+ struct fuse_out_header * statx ;
53515355};
53525356
53535357// Link the reponse to the request and send it to /dev/fuse.
@@ -5496,6 +5500,9 @@ static volatile long syz_fuse_handle_req(volatile long a0, // /dev/fuse fd.
54965500 case FUSE_IOCTL :
54975501 out_hdr = req_out -> ioctl ;
54985502 break ;
5503+ case FUSE_STATX :
5504+ out_hdr = req_out -> statx ;
5505+ break ;
54995506 default :
55005507 debug ("syz_fuse_handle_req: unknown FUSE opcode\n" );
55015508 return -1 ;
0 commit comments