aboutsummaryrefslogtreecommitdiffstats
path: root/sys/test/any.txt
Commit message (Collapse)AuthorAgeFilesLines
* prog: fix selection of args eligible for squashingDmitry Vyukov2024-04-151-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes 3 issues: 1. We intended to squash only 'in' pointer elems, but we looked at the pointer direction rather than elem direction. Since pointers themselves are always 'in' we squashed a number of types we didn't want to squash. 2. We can squash filenames, which can lead to generation of escaping filenames, e.g. fuzzer managed to create "/" filename for blockdev_filename as: mount(&(0x7f0000000000)=ANY=[@ANYBLOB='/'], ...) Don't squash filenames. 3. We analyzed a concrete arg to see if it contains something we don't want to squash (e.g. pointers). But the whole type can still contain unsupported things in inactive union options, or in 0-sized arrays. E.g. this happened in the mount case above. Analyze the whole type to check for unsupported things. This also moves most of the analysis to the compiler, so mutation will be a bit faster. This removes the following linux types from squashing. 1. These are not 'in': btrfs_ioctl_search_args_v2 btrfs_ioctl_space_args ethtool_cmd_u fscrypt_add_key_arg fscrypt_get_policy_ex_arg fsverity_digest hiddev_ioctl_string_arg hidraw_report_descriptor ifreq_dev_t[devnames, ptr[inout, ethtool_cmd_u]] ifreq_dev_t[ipv4_tunnel_names, ptr[inout, ip_tunnel_parm]] ifreq_dev_t["sit0", ptr[inout, ip_tunnel_prl]] io_uring_probe ip_tunnel_parm ip_tunnel_prl poll_cq_resp query_port_cmd query_qp_resp resize_cq_resp scsi_ioctl_probe_host_out_buffer sctp_assoc_ids sctp_authchunks sctp_getaddrs sctp_getaddrs_old 2. These contain pointers: binder_objects iovec[in, netlink_msg_route_sched] iovec[in, netlink_msg_route_sched_retired] msghdr_netlink[netlink_msg_route_sched] msghdr_netlink[netlink_msg_route_sched_retired] nvme_of_msg 3. These contain filenames: binfmt_script blockdev_filename netlink_msg_route_sched netlink_msg_route_sched_retired selinux_create_req
* prog: support int8 resources in any squashingDmitry Vyukov2022-06-201-1/+3
| | | | | | | | | | | | | | | | | | | | | We've got the following panic: --- FAIL: TestMutateRandom (7.77s) export_test.go:37: seed=1655724857302243235 --- FAIL: TestMutateRandom/test/32_shmem (0.00s) panic: bad size [recovered] panic: bad size goroutine 562 [running]: panic({0x5ea5a0, 0x8dade8}) /usr/local/go/src/runtime/panic.go:1038 +0x215 github.com/google/syzkaller/prog.(*Target).squashResult(0xc0002a9ba0, 0xc026faa7b0, 0xc026ad1bc8) /syzkaller/gopath/src/github.com/google/syzkaller/prog/any.go:236 +0x2d1 This happens because we try to squash resource of size 1. While we still don't have such resources in real descriptions, we've got one in test descriptions (added in out_overlay change). Support int8 resources in squashing procedure.
* prog: don't squash objects that contain pointersDmitry Vyukov2020-05-011-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashing pointers creates several problems: - we need to generate pointer types on the fly, something we don't do in any other contexts, it complicates other changes - pointers are very special as values, if we change size of the surrounding blobs, offsets changes and we will use something that's not a pointer as pointer and vise versa, boths things are most likley very bad as inputs - squashing/any implementation is just too complex This disqualifies several types for squashing: < alloc_pd_cmd < arpt_replace < array[cmsghdr_rds] < create_cq_cmd < create_flow_cmd < create_qp_cmd < create_srq_cmd < ebt_counters_info < ip6t_replace < ipt_replace < mlx5_alloc_pd_cmd < mlx5_create_dv_qp_cmd < open_xrcd_cmd < post_recv_cmd < post_send_cmd < post_srq_recv_cmd < query_qp_cmd < query_srq_cmd < reg_mr_cmd < rereg_mr_cmd < resize_cq_cmd < usbdevfs_urb < vhost_memory < vusb_connect_descriptors and adds few new: > binder_objects > query_qp_resp > resize_cq_resp > usb_bos_descriptor > usb_string_descriptor Overall this looks sane. Majority is still unchanged.
* pkg/compiler: refactor attribute handlingDmitry Vyukov2020-04-191-2/+2
| | | | | | | | | | | | Introduce common infrastructure for describing and parsing attribute instead of custom per-attribute code scattered across several locations. Change align attribute syntax from the weird align_N to align[N]. This also allows to use literal constants as N. Introduce notion of builtin constants. Currently we have only PTR_SIZE, which is needed to replace align_ptr with align[PTR_SIZE].
* prog: properly squash bitfieldsDmitry Vyukov2018-02-261-1/+11
|
* prog: add arbitrary mutation of complex structsDmitry Vyukov2018-02-251-0/+35
Squash complex structs into flat byte array and mutate this array with generic blob mutations. This allows to mutate what we currently consider as paddings and add/remove paddings from structs, etc.