aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux
Commit message (Collapse)AuthorAgeFilesLines
...
* prog: move image extraction from sys/linuxDmitry Vyukov2022-12-227-207/+0
| | | | | | Now that images are not linux-specific, we can move all image-related logic directly into prog package and significantly simplify the logic.
* pkg/image: factor out from progDmitry Vyukov2022-12-221-1/+2
| | | | | | | Move image compression-related function to a separate package. In preperation for subsequent changes that make decompression more complex. Prog package is already large and complex. Also makes running compression tests/benchmarks much faster.
* sys/linux: add MADV_COLLAPSE descriptionZach O'Keefe2022-12-082-1/+2
| | | | MADV_COLLAPSE was added to Linux in 6.1.
* sys/linux: fix nfs mountingDmitry Vyukov2022-11-281-2/+6
| | | | NFS is not image-based filesystem.
* sys/linux: fix afs mountingDmitry Vyukov2022-11-282-8/+21
| | | | | afs is not image-based filesystems. It accepts some server/cell as source argument.
* sys/linux: use common mount options in syz_mount_imageDmitry Vyukov2022-11-281-4/+6
| | | | | Common options like ro/rw/sync/async can be used with any mount. Add them to the options used by syz_mount_image.
* sys/linux: add few new filesystem namesDmitry Vyukov2022-11-281-1/+1
| | | | These are now present in the syzbot kernel (see /proc/filesystems).
* sys/linux: fix pvfs2 mountDmitry Vyukov2022-11-282-7/+10
| | | | It's not image-based filesystem.
* sys/linux: add comments about zonefs/ubifs mountingDmitry Vyukov2022-11-281-2/+13
|
* prog: don't materialize uncompressed image in DeserializeDmitry Vyukov2022-11-251-3/+3
| | | | | | | | | | Currently we uncompress all images in Deserialize to check that the data is valid. As the result deserializing all seeds we have takes ~40 seconds of real time and ~125 seconds of CPU time. And we do this during every syz-manager start. Don't materialize the uncompressed image. This reduces real time to ~15 seconds and CPU time to 18 seconds (no garbage collections). In syz-manager the benefit is even larger since garbage collections take longer (larger heap).
* tools/syz-imagegen: generate fake empty images for all filesystemsDmitry Vyukov2022-11-2516-0/+96
| | | | | Since syz_mount_image calls are no_generate we need to add at least some empty seeds for all for filesystems.
* tools/syz-imagegen: add msdos filesystemDmitry Vyukov2022-11-2460-0/+360
|
* tools/syz-imagegen: add hfs and hfsplus filesystemsDmitry Vyukov2022-11-2416-0/+96
|
* sys/linux: refine BLKPG ioctlDmitry Vyukov2022-11-242-3/+18
| | | | | This ioctl accepts blkpg_partition struct: https://elixir.bootlin.com/linux/v6.1-rc6/source/block/ioctl.c#L20
* sys/linux: increase syz_read_part_table timeoutDmitry Vyukov2022-11-231-1/+1
| | | | In my runs these calls take 80-100ms, so increase it to 200ms.
* sys/linux/test: add syz_read_part_table seedsDmitry Vyukov2022-11-238-0/+48
|
* sys/linux/test: regenerate syz_mount_image seedsDmitry Vyukov2022-11-23628-628/+628
|
* executor: don't pass uncompressed zlib sizeDmitry Vyukov2022-11-2310-75/+68
| | | | | | This will allow us to mutate the image size. Fixes #3527
* sys/linux: fix syz_mount_image$fuse signatureDmitry Vyukov2022-11-231-1/+1
| | | | | | | | Fuse does not need an image and we don't pass image size anyway. But we still pass/mutate an image. Moreover with the no_generate attribute we can't call it at all since we don't have seeds. Fix that.
* sys/linux/init_alg_test.go: change package name to linux_test (#3540)Taras Madan2022-11-221-1/+1
| | | It is an external test. It uses only exported "linux" package functions.
* sys/linux: regenerate `syz_mount_image` seedsHrutvik Kanabar2022-11-21632-632/+632
| | | | | | | | | | | | | | Update seeds to account for the new pseudo-syscall prototype and the new compressed Base64 syntax. This reduces `syz-imagegen` seed image space requirements from 127 MB to 43 MB (measured using `du -ch syz_mount_image_*`). Note that some filesystems are pathological for deflate, e.g. for `f2fs` seed image space has increased from 320 KB to 2.1 MB. This discrepancy should not be observed in corpuses after performing various filesystem operations and image mutations - the previous ad-hoc compression is highly efficient for near-empty images, but once images are modified deflate should surpass it. Tools/versions used are as in google@0d24140 and google@356d821.
* sys/linux: update asset storage for new `syz_mount_image`Hrutvik Kanabar2022-11-214-265/+50
| | | | | | | | | | | | Asset storage is now significantly simpler: we just take the Base64-encoded, compressed image and output it to a file. There is a slight overhead in that we decompress from the `zlib` format and re-compress to the `gzip` format. This commit removes most of the logic from `init_images.go`, and therefore most of the tests from `init_images_test.go`. We could instead keep this logic around and use it to adapt old-style `syz_mount_image` calls in existing corpuses to match the new format.
* sys/linux, tools/syz-imagegen: update `syz_mount_image` to use ↵Hrutvik Kanabar2022-11-213-57/+51
| | | | | | | | | | | | | | | | `compressed_image` Rather than accepting "segments", `syz_mount_image` now accepts a compressed image. Since this is already a corpus-breaking change, also rearrange the arguments so that the image is at the end. This makes it easier to inspect what the other arguments are set to. We need to increase the timeout associated with `syz_mount_image`, as decompression and execution take a little longer. 5000ms should be very generous. This commit updates the descriptions and the `syz-imagegen` tool. The executor, seed images, and asset saving will be updated in future commits.
* sys/linux: add NFC seedDmitry Vyukov2022-11-131-0/+43
|
* sys/linux: add NFC netlink descriptionsDmitry Vyukov2022-11-134-9/+181
| | | | Add NFC netlink descriptions and improve socket descriptions a bit.
* sys/linux: add /dev/virtual_nci descriptionsDmitry Vyukov2022-11-132-0/+334
|
* sys/linux: update const filesDmitry Vyukov2022-11-134-4/+4
| | | | Update const files on next-20221031.
* sys/linux: add iommufd descriptionsJason Gunthorpe2022-11-103-0/+429
|
* sys/linux: fix VFIO map/unmapJason Gunthorpe2022-11-102-4/+8
| | | | | unmap has its own set of flags that trigger interesting behavior. map needs to take in a user_va or it will not succeed in many cases.
* sys/linux: enhance VFIO_IOMMU_GET_INFOJason Gunthorpe2022-11-101-3/+29
| | | | | | | This is a complex nested structure that syskaller doesn't actually need to care about the output for. However it better matches the kernel if we describe it in a similar way. The goal is to make the buffer large enough for the call to succeed.
* sys/linux: describe yama/ptrace_scopeDenis Efremov2022-10-281-0/+11
| | | | Signed-off-by: Denis Efremov <denis.e.efremov@oracle.com>
* sys/linux: remove references to DECnetHrutvik Kanabar2022-10-274-5/+3
| | | | | This was removed from the upstream kernel in: torvalds/linux@1202cdd665315c525b5237e96e0bedc76d7e754f
* sys/linux: add io_uring new featuresLin Ma2022-10-212-12/+180
| | | | Signed-off-by: Lin Ma <linma@zju.edu.cn>
* sys/linux: add EXT4_IOC_GETFSUUID/EXT4_IOC_SETFSUUIDDenis Efremov2022-10-102-0/+13
| | | | | | | | | | | Update ext4 ioctls. Add EXT4_IOC_GETFSUUID/EXT4_IOC_SETFSUUID ioctls which were added upstream in d95efb14c0b8 ("ext4: add ioctls to get/set the ext4 superblock uuid"). In the current code `fsu_flags` is always 0 and `fsu_len` is either 0 or UUID_SIZE. Signed-off-by: Denis Efremov <denis.e.efremov@oracle.com>
* sys/linux/test: add landlock_fs_truncateMickaël Salaün2022-10-061-0/+41
| | | | | | | This test covers file truncation with path and file descriptor checks handled in security/landlock/fs.c . Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
* sys/linux: add the Landlock truncate access flagMickaël Salaün2022-10-062-1/+2
| | | | | | | Add the new LANDLOCK_ACCESS_FS_TRUNCATE flag for the file truncation handling. Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
* sys/linux: add FAN_MARK_{EVICTABLE,IGNORE,INODE} flagsDenis Efremov2022-10-042-1/+4
| | | | Signed-off-by: Denis Efremov <denis.e.efremov@oracle.com>
* sys/linux: fix invalid args in syz_mount_image testsAleksandr Nogikh2022-09-293-4/+3
|
* sys: control structural changes during neutralizationAleksandr Nogikh2022-09-295-24/+52
| | | | | | | | | | | Ideally, we should properly support the already existing fix flag to distinguish between fixing and checking, but for now at least let it control whether structural changes are to be made. Otherwise we get into trouble while hint-mutating syz_mount_image calls, because we iterate over all call arguments and (possibly) remove them at the same time. It leads to `bad group arg size %v, should be <= %v for %#v type %#v` errors.
* sys/linux: fix errorsYu Hao2022-09-281-15/+5
|
* sys/linux: fix errorsYu Hao2022-09-2814-3/+73
|
* sys/linux: extract raw images from syz_mount_imageAleksandr Nogikh2022-09-277-18/+206
| | | | | To simplify the extraction code, let's make segments non-overlapping even before execution.
* executor: move syz_mount_image's sanity checks to syz-fuzzerAleksandr Nogikh2022-09-273-0/+216
| | | | | It will simplify the C code and let us extract the raw images in a more convenient way.
* sys/linux: make `syz_mount_image` a `no_minimize` syscallHrutvik Kanabar2022-09-222-46/+46
| | | | | | | | Minimizing of large images is time-consuming and unlikely to reproduce any errors. This commit therefore marks the `syz_mount_image` pseudo-syscall as ineligible for minimization. A test has also been added to `prog/minimization_test.go`.
* sys/linux: make `syz_mount_image` a `no_generate` syscallHrutvik Kanabar2022-09-222-46/+46
| | | | | | It is quite unlikely that a valid image will be generated from scratch for a `syz_mount_image` call. This commit marks the syscall as an invalid target for generation, ensuring no time is wasted on this.
* executor: add NIC PCI pass-through VF supportGeorge Kennedy2022-09-211-1/+1
| | | | | | | | | | | | | | | Add support for moving a NIC PCI pass-through VF into Syzkaller's network namespace so that it will tested. As DEVLINK support is triggered by setting the pass-through device to "addr=0x10", NIC PCI pass-through VF support will be triggered by setting the device to "addr=0x11". If a NIC PCI pass-through VF is detected in do_sandbox, setup a staging namespace before the fork() and transfer the NIC VF interface to it. After the fork() and in the child transfer the NIC VF interface to Syzkaller's network namespace and rename the interface to netpci0 so that it will be tested. Signed-off-by: George Kennedy <george.kennedy@oracle.com>
* sys/linux: update manual `syz_mount_image` callsHrutvik Kanabar2022-09-134-5/+5
| | | | | | Add the missing boolean argument for changing directory to `syz_mount_image` calls which are not generated by `syz-imagegen`. Set it to false to ensure behaviour is as before.
* sys/linux: regenerate NTFS3 `syz_mount_image` seed imagesHrutvik Kanabar2022-09-1316-16/+16
| | | | | | Now with the ability to change directory. Regenerate on a VM which supports NTFS, using the same versions as google/syzkaller@356d821720a2d24a4cc96f8c0b2b7a11c8882190.
* sys/linux: regenerate `syz_mount_image` seed imagesHrutvik Kanabar2022-09-13612-612/+612
| | | | | | Now including the ability to change directory. Using the same tools/versions as google/syzkaller@0d2414047943397599e7cfc12d40f4582d008726. N.B. in particular, NTFS3 will be updated in the next commit.
* sys/linux, tools/syz-imagegen: allow `syz_mount_image` to change directoryHrutvik Kanabar2022-09-132-46/+46
| | | | | | | | | | | | | | | | | | | | Add a boolean argument to the `syz_mount_image` pseudo-syscall. When this is true, `syz_mount_image` will change directory to the mountpoint after mounting the image passed. Experimentation suggests that to reproduce many non-`ext4` filesystem bugs, it is sufficient to mount the filesystem within an `ext4`-based VM and then change directory to the mountpoint before executing code. This change aims to increase the probability that a mount operation will be succeeded by the corresponding change in directory, and so increase the probability of finding non-`ext4` bugs. We also have to update the `syz-imagegen` tool. Now it generates seed `syz_mount_image` calls with change of directory enabled. The previous behaviour (i.e. no change of directory) will be recovered by use of existing corpuses and fuzzing the change-of-directory argument. The next commit will regenerate all `syz_mount_image` seeds.