Commit Graph

1061 Commits

Author SHA1 Message Date
Dmitry Vyukov
a5c1ab05b3 sys/test: add more tests for bitfields
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");
}
2019-12-13 15:26:10 +01:00
Dmitry Vyukov
cb704a294c executor: fix syz_mount_image
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.
2019-12-10 16:08:35 +01:00
Andrey Konovalov
5a5826a14e sys/linux, dashboard: update USB config and IDs 2019-12-10 12:45:34 +01:00
Marco Vanotti
607350e438 syz/targets: add SyzExecutorCmd flag
This commit adds a new attribute to syzkaller targets that tells
syzkaller how to invoke the syz-executor command.

Some systems, like Fuchsia, are now building syz-executor as part of the
build, and there is no need to copy it over, or to run it from `/tmp`.
In fact, that might stop working at some time in the future in Fuchsia.

All places that used to copy syz-executor into the target machine will
now check for the SyzExecutorCmd flag, and won't copy it if the flag is
set.
2019-12-09 15:13:49 -08:00
Marco Vanotti
1f9a4e330b sys/targets: change clang++ to clang for fuchsia
Syzkaller binaries are built in C mode even if they are c++ binaries.
Recent clang version (clang++-10) consider this an error/warning,
causing issues during build time.

Change-Id: Ia6d1ab46597efc42772c1c7a63188c3c04a729a7
2019-12-09 15:13:49 -08:00
Marco Vanotti
701420fdad sys/targets: fix path for libdriver.so in Fuchsia 2019-12-09 15:13:49 -08:00
Dmitry Vyukov
1508f45368 sys/linux: refine few framebuffer/kbd ioctls 2019-12-07 18:45:45 +01:00
Andrey Konovalov
98b4ef2d37 sys/linux: update USB TODOs 2019-12-05 15:53:48 +01:00
Siddharth Muralee
9fd5a512f3 sys/netbsd: fix the build issues with posix_spawn 2019-12-05 10:06:13 +01:00
Siddharth M
b91ea9289b make required changes to sys/netbsd 2019-12-05 10:06:13 +01:00
R3x
a734d2a6d9 sys/netbsd: add the newer vfork syscall 2019-12-05 10:06:13 +01:00
R3x
e06d2ea701 sys/netbsd: Added posix_spawn and fork syscalls 2019-12-05 10:06:13 +01:00
Dmitry Vyukov
dfe2e9d84a sys/linux: enforce arguments of all syz_open_dev calls
Opening random devices can lead to havoc.
Enforce device major/minor.
2019-12-03 18:48:14 +01:00
Dmitry Vyukov
cbfd910250 sys/linux: more tuning of tty devices
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.
2019-12-03 18:48:14 +01:00
Dmitry Vyukov
a715d760ae sys/linux: add /dev/fb1
qemu -vga cirrus results in /dev/fb0 and /dev/fb1.
2019-12-03 18:48:14 +01:00
Dmitry Vyukov
ab342da3f9 sys/linux: add binderfs descriptions 2019-12-02 18:21:43 +01:00
Dmitry Vyukov
dc01aea003 sys/linux: add /dev/fb descriptions
Framebuffer descriptions + open more tty dev nodes.
2019-12-02 18:17:04 +01:00
Dmitry Vyukov
82d81ba98e sys/linux: regenerate consts
Regenerate consts now that make extract is fixed.
Interestingly some arm consts have changed (arm/i386 abi difference?).
2019-12-02 14:44:04 +01:00
Dmitry Vyukov
3aa380090f sys/syz-extract: extract constants from ELF
Add a second mode that extracts constant values from
ELF object, instead of running the executable.
This allows to not (1) link binaries, (2) use proper cross-compiler.
It finally fixes 386/arm extracts for my distro.
Hopefully not makes things worse for others,
should generally be safer/more reliable.
The current mode is left b/c I can't test all OSes,
windows binaries are not ELF, so we may need it anyway.
But later we may switch more OSes to this new mode
if they break (fuchsia?).
2019-12-02 14:36:47 +01:00
Dmitry Vyukov
f879db37f9 sys/linux: more device refinements
Add some mode /dev/nodes*
Add anoter midi device.
2019-12-01 19:51:52 +01:00
Dmitry Vyukov
5d12311f3a sys/linux: add /dev/ptp descriptions 2019-12-01 19:07:51 +01:00
Dmitry Vyukov
9dfc7e00d5 sys/linux: refine some device types
/dev/pmem0 is a block device.
/dev/adsp1 is the same as /dev/dsp1.
dmmidi,admmidi,amidi is the same as /dev/snd/midi.
2019-12-01 18:29:00 +01:00
Dmitry Vyukov
27d609bf84 sys/linux: add /dev/snd/pcm* descriptions 2019-12-01 17:47:28 +01:00
Dmitry Vyukov
c35a341c32 sys/linux: add /dev/dsp descriptions 2019-12-01 11:08:13 +01:00
Dmitry Vyukov
3504484430 sys/linux: update consts
Regenerate const files for all arches.
2019-12-01 11:03:27 +01:00
Dmitry Vyukov
edcd9e3c9a sys/syz-extract: use clang if gcc is broken
On my Debian gcc -m32 is hopelessly broken.
Using clang fixes at least arch 386.
Arch arm is still broken b/c clang does not like
some of kernel arm inline assemly constraints.
2019-12-01 10:59:54 +01:00
Dmitry Vyukov
a76bf83ffa sys/linux: fix /dev/watch_queue name
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.
2019-11-30 19:17:15 +01:00
Dmitry Vyukov
3a75be00f5 sys/linux: add open of /dev/dri/renderD128
It's created by qemu but is not matched by the existing /dev/dri/renderD# pattern.
2019-11-29 15:03:37 +01:00
Dmitry Vyukov
ad6aec4193 sys/linux: fix NFC_SOCKPROTO_RAW socket call
It requires SOCK_SEQPACKET not SOCK_STREAM.
2019-11-29 14:47:56 +01:00
Dmitry Vyukov
4f7e1d0f5e sys/linux: use openat for /dev/cdrom
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.
2019-11-29 10:46:50 +01:00
Dmitry Vyukov
aac51b70cd sys/linux: use known tags for 9p virtio/xen
Name virtio/xen sources "syz" so that it's possible to expose
it from host and actually use.
2019-11-29 10:46:26 +01:00
Paul Chaignon
7a53a9d93f sys/linux: update BPF constants
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-11-29 10:45:42 +01:00
Shiyu Sun
d496d44718 sys/windows/sys.txt: use bool32 instead of int32[0:1] 2019-11-28 10:01:41 +01:00
Shiyu Sun
ba2dd280e6 sys/linux/socket.txt: add more description for socket ioctls 2019-11-28 10:01:41 +01:00
Shiyu Sun
2e2ab0c725 sys/linux: more update to current linux-next 2019-11-28 10:01:41 +01:00
Andrei Vagin
5a38f3f066 sys/linux: describe PTRACE_PEEKSIGINFO
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-11-27 09:35:58 +01:00
Christian Brauner
bc992c0ee4 sys/linux: add new arguments to struct clone_args for clone3()
Linux v5.5 extends struct clone_args for clone3() by two additional
parameters:

@set_tid:      Pointer to an array of type *pid_t. The size
               of the array is defined using @set_tid_size.
               This array is used to select PIDs/TIDs for
               newly created processes. The first element in
               this defines the PID in the most nested PID
               namespace. Each additional element in the array
               defines the PID in the parent PID namespace of
               the original PID namespace. If the array has
               less entries than the number of currently
               nested PID namespaces only the PIDs in the
               corresponding namespaces are set.
@set_tid_size: This defines the size of the array referenced
               in @set_tid. This cannot be larger than the
               kernel's limit of nested PID namespaces.

Cc: Adrian Reber <areber@redhat.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-11-26 13:07:43 +01:00
Eric Biggers
f72ffd024d sys/linux/fscrypt.txt: add FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64
This flag is new in 5.5.

Also add a link to the fscrypt API documentation.
2019-11-26 11:34:30 +01:00
Eric Biggers
f746151a93 sys/linux/init_alg.go: add new algorithms
Add new crypto algorithms from linux-next (future v5.5):

- BLAKE2b and BLAKE2s
- "-arm" implementations of ChaCha and XChaCha
- "-arm" and "-neon" implementations of Poly1305
2019-11-25 20:23:10 +01:00
Dmitry Vyukov
6bfd3dd23b sys/linux: update to current linux-next
Regenerate consts on linux-next next-20191125.
DEVLINK_ATTR_NETNS_* consts were chifted by 1.
__BPF_FUNC_MAX_ID increased as usual.
CRYPTO_ALG_TYPE_BLKCIPHER, CRYPTO_ALG_TYPE_ABLKCIPHER were removed,
replace them with CRYPTO_ALG_TYPE_SKCIPHER.
2019-11-25 14:30:28 +01:00
Dmitry Vyukov
0199dc9d8c sys/linux: add a NEED comment 2019-11-22 09:40:46 +01:00
Denis Efremov
e89749efe8 sys/linux: run "make generate" for smack
Signed-off-by: Denis Efremov <efremov@linux.com>
2019-11-22 09:14:41 +01:00
Denis Efremov
dd653133d5 sys/linux: extract constants for smack.txt
Signed-off-by: Denis Efremov <efremov@linux.com>
2019-11-22 09:14:41 +01:00
Denis Efremov
159175a74a sys/linux: update smack descriptions
Add descriptions for /sys/fs/smackfs/* interfaces.

Signed-off-by: Denis Efremov <efremov@linux.com>
2019-11-22 09:14:41 +01:00
Dmitry Vyukov
b5c36524a2 sys/targets: add HostFuzzer flag
Move HostFuzzer from vm/qemu.
It's needed in a number of other packages
and strictly saying is not specific to qemu
(it just happened that both fuchsia and akaros only support qemu).
2019-11-16 09:58:54 +01:00
David Pursell
79248ee88b sys/fuchsia: remove deprecated exception APIs
The port-based exception APIs have been deprecated on Fuchsia and will
be removed shortly. Delete them from the syscall definitions and
modify the Fuchsia executor to use the new channel-based APIs instead.
2019-11-14 16:21:01 -08:00
David Pursell
a3f5ce76b1 sys/fuchsia: fix Fuchsia extract/generate
Updates some paths and add zx_eventpair type definition to fix
`make extract` and `make generate`.
2019-11-14 16:21:01 -08:00
Jiri Pirko
5d15a96786 sys/linux/socket.txt: add devlink pci related netdev
Add netdev name related to pci netdev and fix comment for netdevsim0.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
2019-11-14 09:21:37 +01:00
Dmitry Vyukov
b17cbe9d11 sys/targets: don't run flag tests on non-build OS
We should not try to do any builds for such targets anyway.
And the compiler does not have to exist/work.
2019-11-07 11:06:56 +01:00
Dmitry Vyukov
0281aea335 sys/linux: fix up some int64 syscall args
See the discussion on #1493.
These args are actually intptr's.
2019-11-07 11:06:48 +01:00