aboutsummaryrefslogtreecommitdiffstats
path: root/executor
Commit message (Collapse)AuthorAgeFilesLines
* pkg/compiler: fix bitfield layout bugDmitry Vyukov2019-12-201-10/+10
| | | | | | Fixes #1542 Found thanks to syz-check. Update #590
* pkg/compiler: fix alignment of string-formatted valuesDmitry Vyukov2019-12-201-6/+6
| | | | | | We used size as alignment, this is very wrong. Found thanks to syz-check. Update #590
* executor: make syz_compare output more handy to useDmitry Vyukov2019-12-201-8/+9
|
* sys/test: and another set of bitfield testsDmitry Vyukov2019-12-202-5/+6
| | | | | | Just trying to get my head around it (and fix this in tests). Update #1542
* sys/test: and another bitfield testDmitry Vyukov2019-12-191-4/+4
| | | | | | Just trying to get my head around it (and fix this in tests). Update #1542
* prog: refactor bitfields representationDmitry Vyukov2019-12-191-12/+12
| | | | | | | | All callers of BitfieldMiddle just want static size (0 for middle). Make it so: Size for middle bitfields just returns 0. Removes lots of if's. Introduce Type.UnitSize, which now holds the underlying type for bitfields. This will be needed to fix #1542 b/c even if UnitSize=4 for last bitfield Size can be anywhere from 0 to 4 (not necessary equal to UnitSize due to overlapping).
* sys/test: add few other tests for tricky bitfieldsDmitry Vyukov2019-12-181-4/+4
| | | | Update #1542
* pkg/compiler: fix incorrect alignment calculation for paddingDmitry Vyukov2019-12-181-6/+6
| | | | | | | | | | | | | | We assumed that for ConstType alignment is equal to size, which is perfectly reasonable for normal int8/16/32/64/ptr. However, padding is also represented by ConstType of arbitrary size, so if we added 157 bytes of padding that becomes alignment of the padding field and as the result of the whole struct. This affects very few structs, but quite radically and quite important structs. Discovered thanks to syz-check. Update #590
* sys/linux: another batch of syz-check fixesDmitry Vyukov2019-12-181-6/+6
| | | | Update #590
* sys/linux: fix few bugsDmitry Vyukov2019-12-181-6/+6
| | | | Fix some descirptions disperancies with kernel and regenerate warnings on next-20191218.
* sys/linux: support new split sound ioctlsDmitry Vyukov2019-12-182-30/+54
| | | | | | Some sounds ioctls are now explicitly doubled for 32/64 bits. Support that. Fix mips SOL_SOCKET issues by rearranging includes. Improve few other fields.
* sys/linux: various descriptions fixesAndrey Konovalov2019-12-181-6/+6
|
* sys/linux: regenerate constsDmitry Vyukov2019-12-171-6/+6
| | | | | Regenerate on next-20191217. Rename s/VMADDR_CID_RESERVED/VMADDR_CID_LOCAL/ as it was renamed in kernel.
* Autogenerated files for linux/mips64leJouni Hogander2019-12-172-0/+2901
| | | | | | | | | This patch adds all autogenerated files for linux/mips64le. Files are generated by following commands: make extract bin/syz-extract -build -os=linux -arch=mips64le -sourcedir=linux make generate
* Implement basic support for MIPS64LEJouni Hogander2019-12-171-0/+2
| | | | | | | | | Add basic stuff to enable MIPS64ELR2 target: - build - make extract - make generate - qemu execution - system call parsing from /proc/kallsyms
* executor: fix FUTEX_WAKE callDmitry Vyukov2019-12-161-1/+1
| | | | | | | | | Amusingly we never passed number of threads to wake for FUTEX_WAKE. It somehow worked reliably on linux (we just needed it to not be 0, so presumably garbage in registers did it). However, in gVisor every other syscall wasn't even started (first syscall on a thread started, but second on the same worker thread wasn't unable to start).
* sys/linux: minor improvements for USB descriptionsAndrey Konovalov2019-12-161-5/+5
| | | | | | 1. Define endpoint maxpacket as flags with a few valid values. 2. Define bits of bmNetworkCapabilities.
* sys/test: add more tests for bitfieldsDmitry Vyukov2019-12-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tests for issue #1542 The correct results are obtained with the following program: struct foo { unsigned char f0; unsigned int f1:4; unsigned short f2:4; }; struct bar { char f0; struct foo foo; }; int main() { struct bar y; memset(&y, 0, sizeof(y)); y.f0 = 0x12; y.foo.f0 = 0x34; y.foo.f1 = 0x56; y.foo.f2 = 0x78; int i; for (i = 0; i < sizeof(y); i++) printf("%02x", ((unsigned char*)&y)[i]); printf("\n"); }
* executor: update raw gadget interfaceAndrey Konovalov2019-12-111-5/+7
|
* executor: check pwrite return values againDmitry Vyukov2019-12-101-2/+10
| | | | | | | | | | | | | | | | | | | | | Build with some gcc's fails: In file included from executor/executor.cc:133:0: executor/common_linux.h: In function ‘long int syz_read_part_table(long unsigned int, long unsigned int, long int)’: executor/common.h:117:15: error: ignoring return value of ‘ssize_t pwrite(int, const void*, size_t, __off_t)’, declared with attribute warn_unused_result [-Werror=unused-result] __VA_ARGS__; \ ^ executor/common_linux.h:1279:3: note: in expansion of macro ‘NONFAILING’ NONFAILING(pwrite(memfd, segs[i].data, segs[i].size, segs[i].offset)); ^ executor/common_linux.h: In function ‘long int syz_mount_image(long int, long int, long unsigned int, long unsigned int, long int, long int, long int)’: executor/common.h:117:15: error: ignoring return value of ‘ssize_t pwrite(int, const void*, size_t, __off_t)’, declared with attribute warn_unused_result [-Werror=unused-result] __VA_ARGS__; \ ^ executor/common_linux.h:1364:3: note: in expansion of macro ‘NONFAILING’ NONFAILING(pwrite(memfd, segs[i].data, segs[i].size, segs[i].offset)); ^ cc1plus: all warnings being treated as errors
* executor: fix syz_mount_imageDmitry Vyukov2019-12-103-33/+32
| | | | | | | 1. It always crashed in cover_reset when coverage is disabled. 2. Use NONFAILING when accessing image segments. 3. Give it additional 100 ms as it may be slow. 4. Add a test for syz_mount_image.
* sys/linux: refine few framebuffer/kbd ioctlsDmitry Vyukov2019-12-072-35/+60
|
* executor: don't use static_assertDmitry Vyukov2019-12-061-2/+2
| | | | | Not all gcc's everywhere support C++11 by default. We have some old on Travis.
* executor: fix remote coverage setupDmitry Vyukov2019-12-061-15/+39
| | | | | | | | | Layout of kcov_remote_arg is ABI-dependent, as the result when 32-bit userspace talks to 64-bit kernel it does not work out of the box. We need both statically different structs for kernels of different bitnesses, but also dynamic dispatch because a 32-bit userspace can talk to both 64-bit and 32-bit kernels.
* sys/netbsd: fix the build issues with posix_spawnSiddharth Muralee2019-12-051-1/+1
|
* sys/netbsd: add the newer vfork syscallR3x2019-12-052-1/+2
|
* sys/netbsd: Added posix_spawn and fork syscallsR3x2019-12-053-1/+4
|
* sys/linux: more tuning of tty devicesDmitry Vyukov2019-12-032-10/+25
| | | | | | | | | Enable /dev/tty{1-6}. These seem to be special. Few first connected to framebuffers. But the rest seem to be different from e.g. tty20 anyway. Also /dev/tty is different from the rest. /dev/ttyS3 and /dev/ttyprintk are different. Properly pair BSD pty terminals.
* sys/linux: add /dev/fb1Dmitry Vyukov2019-12-032-5/+10
| | | | qemu -vga cirrus results in /dev/fb0 and /dev/fb1.
* sys/linux: add binderfs descriptionsDmitry Vyukov2019-12-022-5/+10
|
* sys/linux: add /dev/fb descriptionsDmitry Vyukov2019-12-022-5/+125
| | | | Framebuffer descriptions + open more tty dev nodes.
* sys/linux: regenerate constsDmitry Vyukov2019-12-021-1/+1
| | | | | Regenerate consts now that make extract is fixed. Interestingly some arm consts have changed (arm/i386 abi difference?).
* sys/linux: more device refinementsDmitry Vyukov2019-12-012-5/+45
| | | | | Add some mode /dev/nodes* Add anoter midi device.
* sys/linux: add /dev/ptp descriptionsDmitry Vyukov2019-12-012-5/+85
|
* sys/linux: refine some device typesDmitry Vyukov2019-12-012-10/+25
| | | | | | /dev/pmem0 is a block device. /dev/adsp1 is the same as /dev/dsp1. dmmidi,admmidi,amidi is the same as /dev/snd/midi.
* sys/linux: add /dev/snd/pcm* descriptionsDmitry Vyukov2019-12-012-5/+185
|
* sys/linux: add /dev/dsp descriptionsDmitry Vyukov2019-12-012-10/+195
|
* sys/linux: update constsDmitry Vyukov2019-12-011-1/+1
| | | | Regenerate const files for all arches.
* sys/linux: fix /dev/watch_queue nameDmitry Vyukov2019-11-301-5/+5
| | | | | | | | | It's /dev/watch_queue not /dev/fd_watch_queue. Don't know if it was renamed, or alwys wrong, but does not matter much, now it's /dev/watch_queue. Also attach v4l ioctls to /dev/swradio,radio,vbi,cec. It seems that _some_ of them are applicable to these devices as well.
* sys/linux: add open of /dev/dri/renderD128Dmitry Vyukov2019-11-292-5/+10
| | | | It's created by qemu but is not matched by the existing /dev/dri/renderD# pattern.
* sys/linux: fix NFC_SOCKPROTO_RAW socket callDmitry Vyukov2019-11-291-5/+5
| | | | It requires SOCK_SEQPACKET not SOCK_STREAM.
* sys/linux: use openat for /dev/cdromDmitry Vyukov2019-11-292-10/+15
| | | | | No need to use syz_open_dev here, openat will do. Also add /dev/cdrom1 b/c qemu -machine q35 creates cdrom1 instead of cdrom.
* sys/linux: use known tags for 9p virtio/xenDmitry Vyukov2019-11-291-5/+5
| | | | | Name virtio/xen sources "syz" so that it's possible to expose it from host and actually use.
* sys/linux: update BPF constantsPaul Chaignon2019-11-291-5/+5
| | | | Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
* pkg/csource: detect common mistakes in the common executor headerDmitry Vyukov2019-11-281-2/+4
|
* executor: Add debug message in case devlink namespace move failsJiri Pirko2019-11-281-2/+6
| | | | Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* executor: Fix value of DEVLINK_ATTR_NETNS_FDJiri Pirko2019-11-281-1/+1
| | | | | | | During kernel -net and -next-next trees merge, the value got moved. Fix it. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* sys/linux/socket.txt: add more description for socket ioctlsShiyu Sun2019-11-282-5/+115
|
* sys/linux: more update to current linux-nextShiyu Sun2019-11-281-2/+2
|
* sys/linux: describe PTRACE_PEEKSIGINFOAndrei Vagin2019-11-272-5/+10
| | | | Signed-off-by: Andrei Vagin <avagin@gmail.com>