aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux
Commit message (Collapse)AuthorAgeFilesLines
* pkg/declextract: emit more netlink familiesDmitry Vyukov2024-12-113-0/+59
| | | | Emit families w/o policy, emit duplicate commands.
* pkg/declextract: refine more networking typesDmitry Vyukov2024-12-111-73/+35
|
* pkg/declextract: refactor netlink generationDmitry Vyukov2024-12-111-2062/+2148
| | | | | | | Emit all information related to a single netlink family close to each other. Previously we emitted them scattered and grouped by info type. That was both inconvinient to emit and inconvinient to read. NFC.
* pkg/declextract: rename generated names for consistencyDmitry Vyukov2024-12-111-1258/+1258
| | | | | | Currently we append "$auto", or "$auto_record", or prepend "auto_", or insert "auto" somewhere in the middle. Use more consistent naming: always append "$auto".
* tools/syz-declextract: rewriteDmitry Vyukov2024-12-113-142/+432
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | syz-declextract accumulated a bunch of code health problems so that now it's hard to change/extend it, lots of new features can only be added in in hacky ways and cause lots of code duplication. It's also completly untested. Rewrite the tool to: - move as much code as possible to Go (working with the clang tool is painful for a number of reasons) - allow testing and add unit tests (first layer of tests test what information is produced by the clang tool, second layer of tests test how that information is transformed to descriptions) - allow extending the clang tool output to export arbitrary info in non-hacky way (now it produces arbitrary JSON instead of a mix of incomplete descriptions and interfaces) - remove code duplication in the clang tool and provide common infrastructure to add new analysis w/o causing more duplication - provide more convinient primitives in the clang tool - improve code style consistency and stick to the LLVM code style (in particular, variable names must start with a capital letter, single-statement blocks are not surrounded with {}) - remove intermixing of code that works on different levels (currently we have AST analysis + busness logic + printfs all intermixed with each other) - provide several helper Go packages for better code structuring (e.g. pkg/clangtool just runs the tool on source files in parallel and returns results, this already separates a bunch of low-level logic from the rest of the code under a simple abstraction) I've tried to make the output match the current output as much as possible so that the diff is managable (in some cases at the cost of code quality, this should be fixed in future commits). There are still some differences, but hopefully they are managable for review (more includes/defines, reordered some netlink attributes). Fixed minor bugs are fixed along the way, but mostly NFC: 1. Some unions were incorrectly emitted as [varlen] (C unions are never varlen). 2. Only a of [packed], [align[N]] attributes was emitted for struct (both couldn't be emitted).
* pkg/compiler: add automatic metaDmitry Vyukov2024-12-111-928/+930
| | | | | | Mark the whole file with "meta automatic" instead of marking each syscall. This reduces size of descriptions + allows to do special things with the whole file (e.g. we already treat auto consts specially).
* sys/linux/test: add syz_kvm_assert_syzos_uexit to existing testsAlexander Potapenko2024-12-119-1/+63
|
* pkg/vminfo: sys/linux: executor: define syz_kvm_assert_syzos_uexit()Alexander Potapenko2024-12-111-0/+2
| | | | | The new pseudo-syscall will serve as a test assertion, checking the uexit return value. This is going to help us validate SyzOS code.
* prog: annotate image assets with fsck logsFlorent Revest2024-12-091-14/+14
| | | | | | | | | | | | | | | | | | Syscall attributes are extended with a fsck command field which lets file system mount definitions specify a fsck-like command to run. This is required because all file systems have a custom fsck command invokation style. When uploading a compressed image asset to the dashboard, syz-manager also runs the fsck command and logs its output over the dashapi. The dashboard logs these fsck logs into the database. This has been requested by fs maintainer Ted Tso who would like to quickly understand whether a filesystem is corrupted or not before looking at a reproducer in more details. Ultimately, this could be used as an early triage sign to determine whether a bug is obviously critical.
* sys/linux/tests: add a seed that unrolls syz_kvm_vgic_v3_setup()Alexander Potapenko2024-12-061-0/+23
| | | | | Provide a test case that replaces syz_kvm_vgic_v3_setup() with a sequence of 5 KVM ioctls.
* sys/linux/test: add seeds for known KVM bugsAlexander Potapenko2024-12-069-0/+119
|
* sys/linux/test: disable threading in syzos testsAlexander Potapenko2024-12-068-8/+8
| | | | | Syscalls that initialize KVM and set up syzos have to be executed in the particular order, there's no point in running them concurrently.
* sys/linux: updated fuse fs specificationsSablin Viacheslav2024-11-296-10/+114
|
* sys/linux/dev_kvm_arm64.txt: remove the unneeded definesAlexander Potapenko2024-11-261-80/+0
| | | | Now that we include linux/irqchip/arm-gic-v3.h, we don't need them anymore.
* sys/linux/dev_kvm_arm64.txt: add ITS registers to syzos_api_memwriteAlexander Potapenko2024-11-262-0/+31
| | | | Hint syzkaller that it can write to ITS registers.
* sys/linux: move some ARM-specific descriptions to a separate fileAlexander Potapenko2024-11-264-408/+432
| | | | | | | | | | | | | | This is done to solve a particular test failure running: $ tools/syz-env go test ./prog -run TestSpecialStructs , which failed on PPC64, because prog/rand.go instanciated a call to syz_kvm_setup_syzos_vm(), which requested too much memory (1024 pages) from the allocator (PPC64 uses 64k pages, so the number of available pages is lower). On the other hand, factoring out syzos-related descriptions is probably a nice thing to do anyway.
* sys/linux/test: add a test for SYZOS_API_ITS_SEND_CMDAlexander Potapenko2024-11-261-0/+32
|
* sys/linux/test: invoke SYZOS ITS setup in ↵Alexander Potapenko2024-11-261-9/+11
| | | | | | arm64-syz_kvm_setup_syzos_vm-vgicv3-its Make sure the test actually performs guest-side ITS setup and invokes an LPI.
* executor: arm64: sys/linux: allocate 1024 pages for guest address spaceAlexander Potapenko2024-11-268-9/+9
| | | | | | | Pass 1024 pages of memory to both syz_kvm_setup_syzos_vm() and syz_kvm_setup_cpu$arm64() to make sure that: - there is enough memory for guest allocations (e.g. ITS pages) - host can tamper with that memory, provoking more bugs
* sys/linux/dev_kvm.txt: support SYZOS_API_ITS_SEND_CMDAlexander Potapenko2024-11-262-0/+40
|
* sys/linux/dev_kvm.txt: describe SYZOS_API_ITS_SETUPAlexander Potapenko2024-11-261-0/+7
|
* tools/syz-declextract: prefix flags with auto_Dmitry Vyukov2024-11-261-2/+2
| | | | They can clash with our manual flags names.
* sys/linux: update descriptions/constsDmitry Vyukov2024-11-269-28/+188
| | | | | | | Update to upstream commit 228a1157fb9f. VFIO_TYPE1_NESTING_IOMMU const was removed in 35890f85573c. Remove it from descriptions.
* tools/syz-declextract: support nested netlink policiesDmitry Vyukov2024-11-182-151/+520
|
* tools/syz-declextract: don't generate NLA_REJECT/TYPE_MAX attrsDmitry Vyukov2024-11-181-4/+0
| | | | These are not accepted as inputs (NLA_REJECT is usually used in dump operation).
* sys/linux: remove nl_generic_attr_nonested hackDmitry Vyukov2024-11-181-6/+1
| | | | | It was needed to work around restriction on recursion via arrays. Since we permit it now, we can remove the hack.
* tools/syz-declextract: add heuristic for sigsetsizeDmitry Vyukov2024-11-141-11/+11
|
* tools/syz-declextract: improve name matching heuristicsDmitry Vyukov2024-11-141-95/+95
|
* sys/linux: ensure that auto descriptions are self-sufficientDmitry Vyukov2024-11-141-1/+1
| | | | | Test that if we enable only auto descriptions, nothing gets disabled. Currently nothing can create fd_cgroup which is used by the descriptions.
* tools/syz-declextract: store interfaces info in a text fileDmitry Vyukov2024-11-142-12622/+925
| | | | | | | | | | One line per interface allows to use all power of unix utilities to process these files. For example the following command allow to select all unpriviledged interfaces present in one kernel but not in another: comm -23 <(cat auto1.info | grep access:user | cut -f -2 | sort) \ <(cat auto2.info | cut -f -2 | sort)
* tools/syz-declextract: fix generic netlink family namesDmitry Vyukov2024-11-131-1/+1
|
* pkg/compiler: add consts to all files that mention themDmitry Vyukov2024-11-1337-309/+889
| | | | | | | | | We already do this in most cases except for template structs (nlattr notably). Add consts that are used in template structs to all files that use them. This helps to avoid flakiness, and allows to replace descriptions files with other descriptions files without regenerating all const files. This also fixes check for presence of descriptions for sys/linux/auto.txt.json.
* tools/syz-declextract: fix reserved struct field namesDmitry Vyukov2024-11-131-4/+4
|
* tools/syz-declextract: improve declaration name extractionDmitry Vyukov2024-11-131-0/+14
| | | | | | | Extracting declaration name is trickier than removing casts. If the initialized type is a union, then the expression may also contain InitListExpr and other nodes. Remove all of them in a more robust way.
* sys/linux: add new ioctls for io_uring, dev_block and fsSablin Viacheslav2024-11-136-7/+89
|
* tools/syz-declextract: add syscall entry functionDmitry Vyukov2024-11-121-0/+519
|
* tools/syz-declextract: add entry function and access levelDmitry Vyukov2024-11-121-0/+914
| | | | For now for netlink only.
* sys/linux: regenerate automatic descriptionsDmitry Vyukov2024-11-1123-8631/+595
|
* tools/syz-declextract: enumerate io_uring operationsDmitry Vyukov2024-11-112-314/+1015
|
* tools/syz-declextract: annotate interfaces with descriptions presenceDmitry Vyukov2024-11-111-867/+2601
|
* tools/syz-declextract: fix non-determinism and syscall selectionDmitry Vyukov2024-11-113-40/+76
| | | | | | | | | Currently syscall selection is non-deterministic and we frequently choose wrond ones. This leads to flaky argument names/types, and wrong argument types (e.g. int16 instead of uid, old_utimbuf32 instead of utimbuf, etc). Make syscall selection robust and correct.
* sys/linux: regenerate const filesDmitry Vyukov2024-11-111-1/+0
|
* sys/linux: update 9p mount optionsSablin Viacheslav2024-11-111-0/+4
|
* sys/linux: add test_dummy_encryption=v1 mount flag for ext4 and f2fsSablin Viacheslav2024-11-051-166/+168
|
* sys/linux: added new ioctls for f2fsSablin Viacheslav2024-11-042-0/+26
|
* sys/linux: use syz_init_net_socket for bluetoothSabyrzhan Tasbolatov2024-10-301-4/+4
| | | | | | Replace socket_$bt_{bnep, cmtp, hidp, rfcomm} to syz_init_net_socket. Fixes: https://github.com/google/syzkaller/issues/4729
* tools/syz-declextract: add files/subsystems for interfacesDmitry Vyukov2024-10-251-864/+6121
|
* tools/syz-declextract: rework interface list handlingDmitry Vyukov2024-10-251-0/+3458
| | | | | | | | Produce both descriptions and interface list in one run (it's slow, we don't want/need to run the tool twice). Produce output in json format. Later we will add more properties, and will do more processing of the list.
* tools/syz-declextract: make fixed header more readableDmitry Vyukov2024-10-251-3/+3
| | | | Combine all fixed header parts in a single raw string literal.
* sys/linux: regenerate descriptionsDmitry Vyukov2024-10-255-378/+452
| | | | Regenerate descriptions on kernel commit 715ca9dd687f89ddaac8ec8ccb3b5e5a30311a99.