Commit Graph

1475 Commits

Author SHA1 Message Date
Andrey Konovalov
af47d1d5c0 sys/linux: rename ipvs.txt to netfilter_ipvs.txt 2020-06-12 18:42:12 +02:00
Andrey Konovalov
8ddccc2581 sys/linux: rename fsverity.txt to fs_ioctl_fsverity.txt 2020-06-12 18:42:12 +02:00
Andrey Konovalov
2a2ff48439 sys/linux: rename fscrypt.txt to fs_ioctl_fscrypt.txt 2020-06-12 18:42:12 +02:00
Andrey Konovalov
562406d573 sys/linux: rename fuse.txt to fs_fuse.txt 2020-06-12 18:42:12 +02:00
Andrey Konovalov
9a5c775864 sys/linux: rename 9p.txt to fs_9p.txt 2020-06-12 18:42:12 +02:00
Andrey Konovalov
c94245053a sys/linux: rename fs_btrfs.txt to fs_ioctl_btrfs.txt 2020-06-12 18:42:12 +02:00
Andrey Konovalov
ea75f0e93e sys/linux: rename fs_ext4.txt to fs_ioctl_ext4.txt 2020-06-12 18:42:12 +02:00
Andrey Konovalov
a47f57a951 sys/linux: rename apparmor.txt to security_apparmor.txt 2020-06-12 18:42:12 +02:00
Andrey Konovalov
5644d14ff1 sys/linux: rename selinux.txt to security_selinux.txt 2020-06-12 18:42:12 +02:00
Andrey Konovalov
0b84f68300 sys/linux: rename smack.txt to security_smack.txt 2020-06-12 18:42:12 +02:00
Andrey Konovalov
1e72cce4ed sys/linux: rename devio.txt to dev_bus_usb.txt 2020-06-12 18:42:12 +02:00
Alexey Kardashevskiy
819b58b09f ppc64: Increase page size
The default configuration on PPC64 uses 64K system page size. Having it
4K was not a problem until recently when 365fba2440
"executor: surround the data mapping with PROT_NONE pages" added
surrounding mappings not aligned to the actual system page size.

This changes the page size for ppc64 to 64K and introduces the upper
limit to randPageCount() as we have the hard coded limit of 16MB.
If the unlikely event of a PPC64 system with 4K pages, we will end up
allocating less pages which is not great but acceptable.

This avoids using os.Getpagesize() as the page size on a building host
may be different than on the test machine so we always use the bigger
size for simplicity.

Signed-off-by: Alexey Kardashevskiy <aik@linux.ibm.com>
2020-06-12 05:54:26 +02:00
Dmitry Vyukov
829fd56fbf sys/targets: always fail if SOURCEDIR_GOOS is set but compiler is broken
We should not skip the second check as well.
2020-06-11 23:18:52 +02:00
Christoph Paasch
1ffa7b1e77 sys/linux: mptcp: Add netlink-API for MPTCP path-management
MPTCP exposes a generic netlink API to control address advertisement and
subflow-creation. syzkaller should make use of this interface.
2020-06-11 22:16:56 +02:00
Lorenz Bauer
6dd6b37bc7 sys/linux: update BPF_MAP_UPDATE_ELEM to enable more thorough sockmap fuzzing
sockmap and sockhash expect the value of the update syscall to be a file
descriptor for a UDP or TCP socket. Add this knowledge by introducing a
separate union for map update values.
2020-06-11 21:10:50 +02:00
Lorenz Bauer
954e0f8699 sys/linux: update bpf_attach_args
Attaching and detaching can be done on some map types (sockmap) and
the current network namespace as well.
2020-06-11 21:10:50 +02:00
Dmitry Vyukov
5c25fdab08 sys/targets: fail loudly if SOURCEDIR_GOOS is set but compiler is broken
Since we now have SOURCEDIR_{FUCHSIA,AKAROS,NETBSD} exported in the
syz-big-env docker image, this will make CI fail for broken cross-builds too.

Update instructions in the docker image to fix the current problem
with permissions in syz-big-env: we need to tar with --mode=go=u.
2020-06-11 18:06:49 +02:00
TheOfficialFloW
1beaee2171
sys/linux: add l2cap descriptions
* sys/linux: add l2cap descriptions

* sys/linux: restore bpf and fscrypt changes

* sys/linux: restore key.txt
2020-06-11 17:59:37 +02:00
Michael Tüxen
dfdd11f777
sys/targets: use a different SYZ_DATA_OFFSET for 32-bit FreeBSD (#1809)
* sys/targets: use a different SYZ_DATA_OFFSET for 32-bit FreeBSD

It seems that the value used on all platforms (512 << 20) does
not work on 32-bit FreeBSD when using the clang tools.
Try (256 << 20) instead.

* sys/targets: add comment why a non-default value is needed
2020-06-11 17:57:14 +02:00
Marco Vanotti
3ab7a05ad8 sys/targets: fix fuchsiaCFlags
This commit modifies the fuchsia cflags to use the short version of
the «target» flag. The previous code seemed to be broken due to lacking
an `=` after the flag name using the long version.
2020-06-10 18:12:49 -03:00
Eric Biggers
80e99b01d7 sys/linux: update fscrypt descriptions
- Add fscrypt_add_key_arg::key_id and "fscrypt-provisioning" key type
  (Linux 5.6, https://git.kernel.org/linus/93edd392cad7)

- Add FS_IOC_GET_ENCRYPTION_NONCE
  (Linux 5.7, https://git.kernel.org/linus/e98ad464750c)

- Add FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32
  (Linux 5.8, https://git.kernel.org/linus/e3b1078bedd3)
2020-06-10 10:13:43 -07:00
TheOfficialFloW
5caaad3a74
sys/linux: add vhci headers for event packets
* sys/linux: add vhci headers for command packets

* sys/linux: make generate

* sys/linux: use event packet instead of command packets

* sys/linux/vhci.txt: move low-energy entries to hci_ev_le_meta_un

* sys/linux/vhci.txt: add hci_ev_cmd_complete opcodes
2020-06-10 14:11:42 +02:00
Paul Chaignon
b4eca5502e
sys/linux: BPF update for 5.8 merge window part 1
* sys/linux: update BPF constants

Signed-off-by: Paul Chaignon <paul@cilium.io>

* sys/linux: Add BPF_ENABLE_STATS bpf(2) command

Signed-off-by: Paul Chaignon <paul@cilium.io>

* sys/linux: Add BPF_ITER_CREATE bpf(2) command

Signed-off-by: Paul Chaignon <paul@cilium.io>

* sys/linux: Fix BPF_*_GET_NEXT_ID bpf(2) commands

These commands are used to retrieve a new ID for various BPF objects.
With the current command descriptions, however, the output 'next ID' is
treated as an input field.

Fix: c2dcd70 ("sys/linux: update BPF's anonymous structures")
Signed-off-by: Paul Chaignon <paul@cilium.io>

* sys/linux: Add LINK_GET_* bpf(2) commands

Signed-off-by: Paul Chaignon <paul@cilium.io>
2020-06-10 13:16:19 +02:00
Dmitry Vyukov
860c4de9cf sys/linux: regenerate const files on next-20200609 2020-06-09 16:01:11 +02:00
Ricardo Cañuelo
ed70e69f00 sys/linux: v4l2 and vim2: update and add additional const files
Add missing const files for dev_video4linux_vim2m: 386, arm and
ppc64le).

Update dev_video4linux const files.
2020-06-09 15:58:40 +02:00
Ricardo Cañuelo
07fe0fb871 sys/linux: v4l2 and vim2m2 refactoring
Remove a single template parameter to v4l2_buffer, as it should always
use a fd_request descriptor. Update all syscalls that use it.

Refactor the VIDIOC_STREAMON and VIDIOC_STREAMOFF vim2m ioctls to use
v4l2_buf_type_vim2m as a parameter instead of an union.

Remove ioctl$VIDIOC_RESERVED from dev_video4linux.txt (not defined in
upstream kernel).
2020-06-09 15:58:40 +02:00
Ricardo Cañuelo
c5e085d96d sys/linux: specific descriptions for vim2m (v4l2)
Add a set of descriptions to focus the fuzzing process on the V4L2 vim2m
test driver. This should be useful to test the M2M framework.

The syscalls are based on a specific file descriptor for the vim2m
device and a selection of v4l2 ioctls that operate on it. Some of the
existing v4l2 data structure definitions have been extended to allow
restricting and selecting some options in order to narrow down the
fuzzing process.

Initial support for Request API added.
2020-06-09 15:58:40 +02:00
Dmitry Vyukov
948dd3af44 prog: remove target.StringDictionary
The linux string dictionary comes from extremely old times
when we did not have proper descriptions for almost anything,
and the dictionary was a quick hack to guess at least some
special strings.
Now we have way better descriptions and the dictionary
become both unnecessary and probably even harmful.
2020-06-07 10:41:01 +02:00
Matt Morehouse
e6b89e4e5a sys/linux: add MREMAP_DONTUNMAP flag
Update https://github.com/google/syzkaller/issues/533.
2020-06-06 07:49:50 +02:00
Matthew Dempsky
f243c88ffd sys/fuchsia: regenerate FIDL descriptions
This commit is the results of running:

  rm sys/fuchsia/*.const sys/fuchsia/*.syz.txt
  TARGETOS=fuchsia make extract
2020-06-05 15:08:57 -03:00
Matthew Dempsky
57a83e9453 sys/fuchsia: update "make extract" support code
FIDL fuzzing hasn't been working for a while, and it's further
bit-rotted as upstream FIDL functionality has continued to evolve.
This commit updates enough FIDL functionality to get a minimal FIDL
test case to work again.
2020-06-05 15:08:57 -03:00
Dmitry Vyukov
48b44e1ce0 .golangci.yml: reenable dupl checker
At some point it was enabled, but then somehow got disabled.
Re-enable and fix some regressions.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
503fd5b2f7 .golangci.yml: enable whitespace checker
Points to bad empty lines very precisely.
2020-06-05 12:23:19 +02:00
Michael Tuexen
2bacf9b5a6 sys/freebsd: mark some fields as big endian 2020-06-04 12:35:47 +02:00
Matthew Dempsky
f3ba1b5b7b sys/syz-sysgen: add -src and -out flags
This is useful for integrating into Fuchsia's build system, where we
need to be able to run syz-sysgen with a read-only source directory,
and emit the output files elsewhere.
2020-06-02 10:29:24 -07:00
Dmitry Vyukov
52fd7b7d77 tools: add syz-big-env
On top of syz-env it provides akaros/fuchsia/netbsd toolchains and gcloud sdk.
With this it's possible to run dashboard/app tests on CI and locally
and test executor build and pkg/{csource,cover} for these OSes.

Update #1765
2020-06-02 13:39:30 +02:00
Dmitry Vyukov
d56234396c pkg/cover: support coverage reports on fuchsia 2020-06-02 13:39:30 +02:00
m00nbsd
954bd312f9 sys/netbsd: improve vusb.txt 2020-05-29 21:25:38 +02:00
Dmitry Vyukov
bed0830408 sys/targets: fix cross-compiler CI check
cdc5f8a23e accidentially changed
this condition to a wrong one. Change it back.
2020-05-29 15:33:29 +02:00
Dmitry Vyukov
cdc5f8a23e sys/targets: support SOURCEDIR_GOOS vars
Support SOURCEDIR_GOOS env vars as an alternative to SOURCEDIR.
SOURCEDIR_GOOS takes precedence.
This allows to test several OSes at the same time.

Update #1765
2020-05-29 13:02:19 +02:00
Anton Lindqvist
142a0957d0 sys/openbsd: change type of sysctl namelen argument
The namelen argument must reflect the number of elements in the name
vector. Since it's a vector of integers, bytesize4 seems more
appropriate.

With help from by Dmitry[1].

[1] https://github.com/google/syzkaller/pull/1761#discussion_r430139775
2020-05-27 21:39:33 +02:00
Dmitry Vyukov
fdf90f622b pkg/cover: add test for report generation
Test various combinations of no debug info,
no coverage instrumentation, no PCs, bad PCs, good PCs,
and what errors we produce for these.
Also implement support for cross-arch reports:
prefix objdump with cross-compile prefix
(e.g. aarch64-linux-gnu-objdump instead of objdump).
2020-05-27 14:38:28 +02:00
Dmitry Vyukov
8ca3b7d2bb sys/linux: fix some warnings in descriptions 2020-05-25 18:06:29 +02:00
Dmitry Vyukov
47dd291b8e sys/linux: update warn files on next-20200521 2020-05-25 18:06:29 +02:00
Anton Lindqvist
1128418284 sys/openbsd: add sysctl descriptions 2020-05-24 21:38:38 +02:00
Dmitry Vyukov
cecffa2df9 sys/syz-sysgen: don't format descriptions
Formatting takes 10 seconds.
make format will run go fmt anyway.
2020-05-21 16:18:44 +02:00
Dmitry Vyukov
dd849aa3a2 sys/linux: generate consts on next-20200519 2020-05-20 19:40:08 +02:00
Dmitry Vyukov
204f4fde06 sys/syz-extract: fix for full paths
pkg/ast now uses full paths since 554f8f39c5.
Fix syz-extract accordingly.
2020-05-20 19:38:14 +02:00
m00nbsd
67fa1f59b8 executor: add support for USB fuzzing on NetBSD 2020-05-19 23:07:55 +02:00
Dmitry Vyukov
0ee915a4b7 pkg/runtest: disable broken test combinations
Amusingly this was always broken but nobody was ever able to compile
32-bit binaries on Linux since the addition of the tests.
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
58d6f672b9 sys/targets: check that <dirent.h> works in compilation test
Without linux-libc-dev:i386 installed the test passes,
but executor compilation fails because <dirent.h> is broken.
2020-05-18 11:34:42 +02:00
Ayushi Sharma
37bccd4ed9 sys/netbsd: increase syscall support 2020-05-15 13:43:55 -07:00
Andrey Konovalov
8a9f1e7dbd executor, sys/linux: syz_usb_ep_read/write accept endpoint address
This patch changes syz_usb_ep_read/write pseudo-syscalls to accept endpoint
address as specified in its endpoint descriptor, instead of endpoint index.
2020-05-15 16:30:32 +02:00
Alexander Potapenko
d7f9fffab3 targets: syz-extract: add Clang support for Linux builds
Allow targets.go use Clang instead of the default Linux compiler by
setting the SYZ_CLANG=1 env var. Doing so changes the compiler to
"clang" and the linker to "ld.ldd", assuming they are in $PATH, and adds
the --target and -ferror-limit CFLAGS.

Target also exports KernelCompiler and KernelLinker fields now, which allows
overriding the compiler and linker in the kernel make invocation.

Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-15 14:08:01 +02:00
Alexander Potapenko
4da021feb0 targets.go: append flags in a more readable way
As suggested by Dmitry Vyukov

Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-15 14:08:01 +02:00
Alexander Potapenko
e2993cfc13 targets: replace target.CCompilerPrefix with target.Triple
This field will soon be used in Clang builds. Also, we'd better
encapsulate compiler name generation in targets.go

Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-15 14:08:01 +02:00
Michael Tuexen
2d572622ca sys/targets: fix typo 2020-05-14 11:06:41 +02:00
Michael Tuexen
4dcd09e8cb sys/targets: add -lc++ when building for test os on FreeBSD
This unbreaks gmake presubmit on FreeBSD.
2020-05-14 11:06:41 +02:00
Michael Tuexen
e36b2ae53d sys/targets: fix tests when building on FreeBSD
gmake test is failing on FreeBSD since switching to clang.

To address this:
* use g++ as the C preprocessor for now.
* use a C compiler for compiling C sources and add -lc++ when
  compiling executor.cc. Without this, clang warns about
  using a C++ compiler for compiling C code.
* some test configs add -no-pie, which is not used by clang.
  Add -Wno-unused-command-line-argument to silence a warning
2020-05-14 11:06:41 +02:00
Alexander Potapenko
a99fd8b014 targets: introduce osCommon.cflags, make -static a common flag on Linux
Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-13 13:05:41 +02:00
Alexander Potapenko
88a97d1a7a Get rid of "Cross" in variable names
Renamed Target.BrokenCrossCompiler to Target.BrokenCompiler and
Target.CrossCFlags to Target.CFlags

"Everything in Target is about Cross now."

Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-13 13:05:41 +02:00
Alexander Potapenko
ad606d93b2 targets: delete CFlags
According to
https://github.com/google/syzkaller/pull/1732#issuecomment-627809865,
they have been unused since 3aa3800.

Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-13 13:05:41 +02:00
Dmitry Vyukov
9cea41ad33 sys/syz-sysgen: fix up linux/arm/kvm hack
We have some private files that need to be excluded as well... oh, hacks.
2020-05-12 11:58:00 +02:00
Dmitry Vyukov
160c769827 pkg/mgrconfig: fix errors reported by linter
pkg/mgrconfig/load.go:78:1: cyclomatic complexity 26 of func `Complete` is high (> 24)
sys/targets/targets.go:217: File is not `gofmt`-ed with `-s`
2020-05-12 09:15:58 +02:00
Michael Tuexen
a497a5b4b9 sys/targets: don't remove CrossCFlags 2020-05-12 08:46:41 +02:00
Michael Tuexen
1670262071 sys/targets: use clang on FreeBSD 2020-05-12 08:46:41 +02:00
Ayushi Sharma
44aa83104c
sys/netbsd: add access(2) 2020-05-11 23:18:48 -07:00
Dmitry Vyukov
f4bf31dc3c sys/syz-extract: use -nostdinc on linux
This makes the build completely hermetic.
2020-05-11 16:54:44 +02:00
Dmitry Vyukov
b17a8c4474 sys/linux: extract consts on next-20200511 2020-05-11 16:54:44 +02:00
Dmitry Vyukov
7711af6356 sys/syz-extract: don't warn about unsupported consts for 1 arch
Only warn about unsupported consts when generating consts for all arches.
2020-05-11 16:54:44 +02:00
Dmitry Vyukov
d44f7473de sys/syz-extract: add another compiler message about missing const
New message from clang.
2020-05-11 16:54:44 +02:00
Ayushi Sharma
3b3a2b78da
sys/netbsd: add __getcwd(2) (#1725) 2020-05-11 00:03:33 -07:00
Dmitry Vyukov
8742a2b9db sys/syz-extract: run mrproper for all linux arches
We only run for the current arch, but it's not enough
to clean a build for another arch.
Run mrproper for all non-clean arches.
2020-05-09 16:08:22 +02:00
Dmitry Vyukov
f40567d255 all: reformat code 2020-05-08 14:02:16 +02:00
Dmitry Vyukov
6c70a1c220 all: replace TRAVIS env var with CI
In preparation to running some tests as github actions.
Both Travis and Github define CI env var, while TRAVIS is, well,
too Travis-specific.

Update #1699
2020-05-07 15:41:50 +02:00
Andrey Konovalov
1b2b36d6ab sys/android: dev_ prefix for ion descriptions 2020-05-07 11:26:03 +02:00
Dmitry Vyukov
e42fa3fd02 prog: refactor hints tests
The way the tests fabricate types dynamically creates
problems during any non-trivial changes to prog package.

Use existing types from descriptions instead.
2020-05-05 14:01:52 +02:00
Dmitry Vyukov
1905d7c090 prog: refactor ANY to not fabricate new types
Currently ANY implementation fabricates new types dynamically.
This is something we don't do anywhere else, generally types
come from compiler and all are static.
Dynamic types will conflict with use of Ref in Arg optimization.
Move ANY types creation into compiler.

Update #1580
2020-05-05 14:01:52 +02:00
Dmitry Vyukov
71db69869e sys/linux: mark some ioctls as disabled
Mark ioctls we disable in init.go as disabled.

Update #477
Update #502
2020-05-04 20:56:20 +02:00
Dmitry Vyukov
a4d38b39a8 prog: support disabled attribute
Update #477
Update #502
2020-05-04 20:56:20 +02:00
Dmitry Vyukov
58ae5e1862 prog: remove StructDesc
Remove StructDesc, KeyedStruct, StructKey and all associated
logic/complexity in prog and pkg/compiler.
We can now handle recursion more generically with the Ref type,
and Dir/FieldName are not a part of the type anymore.
This makes StructType/UnionType simpler and more natural.

Reduces size of sys/linux/gen/amd64.go from 5201321 to 4180861 (-20%).

Update #1580
2020-05-03 12:55:42 +02:00
Dmitry Vyukov
58da4c35b1 prog: introduce Field type
Remvoe FieldName from Type and add a separate Field type
that holds field name. Use Field for struct fields, union options
and syscalls arguments, only these really have names.

Reduces size of sys/linux/gen/amd64.go from 5665583 to 5201321 (-8.2%).
Allows to not create new type for squashed any pointer.
But main advantages will follow, e.g. removing StructDesc,
using TypeRef in Arg, etc.

Update #1580
2020-05-02 12:16:06 +02:00
Dmitry Vyukov
bc734e7ada prog: rename {PtrType,ArrayType}.Type to Elem
Name "Type" is confusing when referring to pointer/array element type.
Frequently there are too many Type/typ/typ1/t and typ.Type is not very informative.
It _is_ a type, but what's usually more relevant is that it's an _element_ type.
Let's leave type checking to compiler and give it a more meaningful name.
2020-05-01 13:31:17 +02:00
Dmitry Vyukov
e54e9781a4 prog: remove Dir from Type
Having Dir is Type is handy, but forces us to duplicate lots of types.
E.g. if a struct is referenced as both in and out, then we need to
have 2 copies and 2 copies of structs/types it includes.
If also prevents us from having the struct type as struct identity
(because we can have up to 3 of them).

Revert to the old way we used to do it: propagate Dir as we walk
syscall arguments. This moves lots of dir passing from pkg/compiler
to prog package.
Now Arg contains the dir, so once we build the tree, we can use dirs
as before.

Reduces size of sys/linux/gen/amd64.go from 6058336 to 5661150 (-6.6%).

Update #1580
2020-05-01 13:31:17 +02:00
Dmitry Vyukov
986fa4971c prog: don't squash objects that contain pointers
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.
2020-05-01 13:31:17 +02:00
Dmitry Vyukov
ec42220e77 Makefile: generate descriptions on-the-fly
Checking in the generated descriptions files makes few things simpler,
but causes pain for pull requests: (1) PRs that touch descriptions
_always_ conflict, (2) PRs are large and harder to review,
(3) people sometimes forget to add auto-generated files.

The proposed way does not require us to hardcode lots of dependencies
in the Makefile (which is nice) and seem to work.
Let's see how it works.

The main contributor-visible consequence is that the auto-generated
files do not need to be checked-in now.

Credit for figuring the Makefile magic goes to @melver.

Fixes #1291
2020-04-30 17:18:29 +02:00
Dmitry Vyukov
136082ab38 pkg/cmdprof: add package
cmdprof simplifies cpu/memory profiling for command line tools. Use as:

	flag.Parse()
	defer cmdprof.Install
2020-04-30 17:18:29 +02:00
Dmitry Vyukov
3698959af9 sys/targets: fix detection of optional compiler flags
The test source is now C++, so use -x c++.
Stupid bug, but testing this is not trivial
in the context where we specifically make
behavior "flexible"...
2020-04-30 11:54:39 +02:00
Andy Nguyen
c42af8f753 sys: add mldv2 packet structs
Use special values for hop limit to increase likelihood of triggering certain paths.
2020-04-29 18:55:57 +02:00
Andy Nguyen
bd365072bf sys: add more specific ipv6 options
Additionally fix a type for ipv6_hopopts_ext_header
2020-04-29 16:46:34 +02:00
Dmitry Vyukov
3b93a8e003 sys/targets: better detection for missing/broken cross-compilers
1. Detect when compiler is present, but is not functioning
(can't build a simple program, common for Linux distros).

2. Be more strict with skipping tests due to missing/broken compilers on CI
(on CI they should work, so fail loudly if not).

3. Dedup this logic across syz-env and pkg/csource tests.

4. Add better error reporting for syz-env.

Fixes #1606
2020-04-29 16:32:33 +02:00
Dmitry Vyukov
0ce7569ee7 pkg/compiler: deduplicate Types in descriptions
Add prog.Ref Type that serves as a proxy for real types
and allows to deduplicate Types in generated descriptions.
The Ref type is effectively an index in an array of types.
Just before serialization pkg/compiler replaces real types
with the Ref types and prepares corresponding array of real types.
When a Target is registered in prog package, we do the opposite
operation and replace Ref's with the corresponding real types.

This brings improvements across the board:
compiler memory consumption is reduced by 15%,
test building time by 25%, descriptions size by 33%.

Before:
$ du -h sys/linux/gen
54M	sys/linux/gen

$ time GOMAXPROCS=1 go test -p=1 -c ./prog
real	0m54.200s
real	0m53.883s

$ time GOMAXPROCS=1 go install -p=1 ./tools/syz-execprog
real	0m27.911s
real	0m27.767s

$ TIME="%e %P %M" GOMAXPROCS=1 time go tool compile ./sys/linux/gen
20.59 100% 3200016
20.97 100% 3445976
20.25 100% 3209684

After:
$ du -h sys/linux/gen
36M	sys/linux/gen

$ time GOMAXPROCS=1 go test -p=1 -c ./prog
real	0m42.290s
real	0m43.230s

$ time GOMAXPROCS=1 go install -p=1 ./tools/syz-execprog
real	0m24.337s
real	0m24.727s

$ TIME="%e %P %M" GOMAXPROCS=1 time go tool compile ./sys/linux/gen
19.11 100% 2764952
19.66 100% 2787624
19.35 100% 2749376

Update #1580
2020-04-26 05:58:31 +02:00
Greg Steuck
99b258ddc3 sys/openbsd: extend vnet
* started with freebsd/vnet.txt
  * pruned unsupported items
  * gmake extract
  * gmake generate_sys
  * gmake fomat
2020-04-26 04:43:15 +02:00
Andrey Konovalov
b9233cab41 dashboard/config, sys/linux: update usb config 2020-04-23 16:47:51 +02:00
Ayushi Sharma
2e44d63e40
sys/netbsd: add lchmod(2) (#1687) 2020-04-21 13:22:03 +02:00
Dmitry Vyukov
6dfd45e1d0 sys/syz-sysgen: better formatting for syscall descriptions
We don't really need clang-format for auto-generated code.
We can do better ourselves!
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
2152cfbcb2 all: fix liner errors
pkg/compiler/compiler.go:182: line is 125 characters
func (comp *compiler) parseAttrs(descs map[string]*attrDesc, parent ast.Node, attrs []*ast.Type) (res map[*attrDesc]uint64) {
sys/targets/common.go:47:21: unnecessary conversion
				makeMmap(^uint64(target.PageSize)+1, target.PageSize, 0),
				                ^
sys/targets/common.go:61: File is not `gofmt`-ed with `-s`
			&prog.Call{
sys/windows/init.go:35: File is not `gofmt`-ed with `-s`
		&prog.Call{
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
91db3ed8ce prog: add ignore_return and breaks_returns call attribtues
We had these hard-coded for fuchsia and linux accordingly.
Replace with call attributes.
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
1155a0d1d6 sys/linux: sync call timeouts with executor
Timeouts in executor and sys/linux get out of sync. Sync them.
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
cc8708904d sys/linux: add timeout call attributes
Move additional call/prog timeouts to descriptions.

Due to this logic duplication executor used 50ms
for syz_mount_image, while pkg/csource used 100ms.
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
90d17ab898 prog: introduce call attributes
Add common infrastructure for syscall attributes.
Add few attributes we want, but they are not implemented for now
(don't affect behavior, this will follow).
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
0781895e0f pkg/compiler: refactor attribute handling
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].
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
365fba2440 executor: surround the data mapping with PROT_NONE pages
Surround the main data mapping with PROT_NONE pages to make virtual address layout more consistent
across different configurations (static/non-static build) and C repros.
One observed case before: executor had a mapping above the data mapping (output region),
while C repros did not have that mapping above, as the result in one case VMA had next link,
while in the other it didn't and it caused a bug to not reproduce with the C repro.

The bug that reproduces only with the mapping above:
https://lkml.org/lkml/2020/4/17/819
2020-04-18 14:43:29 +02:00
Dmitry Vyukov
67234372ef prog: refactor target.MakeMmap
Make MakeMmap return more than 1 call.
This is a preparation for future changes.
Also remove addr/size as they are effectively
always the same and can be inferred from the target
(will also conflict with the future changes).
Also rename to MakeDataMmap to better represent
the new purpose: it's just some arbitrary mmap,
but rather mapping of the data segment.
2020-04-18 14:35:45 +02:00
Dmitry Vyukov
ea36da8271 sys/linux: use PROT_EXEC for the data section mmap
Turns out the mmap protection get out of sync
between executor and C reproducers.
C reproducers missed PROT_EXEC.
Add PROT_EXEC for linux, freebsd and akaros.
2020-04-18 10:33:03 +02:00
ais2397@gmail.com
c743fcb3e0 sys/netbsd: add minherit(2) 2020-04-16 07:02:15 +02:00
Dmitry Vyukov
3f3c557402 sys/linux: add some more ipv4/6 addresses
Add few private ipv4/6 addresses that may affect kernel behavior.
2020-04-14 09:11:27 +02:00
Dmitry Vyukov
ffe85af864 sys/linux: regenerate consts
On the current linux-next:
f19bb13a0eaf0034a603e3b54a7c3a50faf6821e (next-20200414)

EXT4_EOFBLOCKS_FL was removed by 4337ecd1fe997d2b2135b4434caaccdb47c10c06

ARM does not support KVM anymore, removed by 541ad0150ca4 ("arm: Remove 32bit KVM host support").

Fixes #1676
2020-04-14 07:37:58 +02:00
ais2397@gmail.com
a517e13956 sys/netbsd: fix struct stat 2020-04-13 21:20:21 +02:00
Paul Chaignon
17a986e54c sys/linux: add link_create and link_update commands
Signed-off-by: Paul Chaignon <paul@cilium.io>
2020-04-12 17:03:47 +02:00
Paul Chaignon
95536f1d7b bpf: update BPF constants
Signed-off-by: Paul Chaignon <paul@cilium.io>
2020-04-12 17:03:47 +02:00
Ayushi Sharma
d9ed075d1a
sys/netbsd: adding chflags(2) syscalls (#1661) 2020-04-04 00:07:51 +02:00
Andrey Konovalov
84da034b1e sys/linux: run usb runtests with namespace/setuid sandbox 2020-04-03 12:42:06 +02:00
Ayushi Sharma
46105100bf
sys/netbsd: adding lwp syscalls (#1654) 2020-03-31 14:14:00 +02:00
Mark Johnston
7d95711b32 sys/freebsd: add Capsicum system calls 2020-03-27 05:51:58 +01:00
Mark Johnston
be07a9be5e sys/freebsd: add __realpathat system call 2020-03-27 05:51:58 +01:00
Mark Johnston
87abd520f8 sys/freebsd: add bindat(2) 2020-03-27 05:51:58 +01:00
Mark Johnston
c37c8bf05b sys/freebsd: add POSIX shared memory system calls 2020-03-27 05:51:58 +01:00
Mark Johnston
ed2c77ae59 sys/freebsd: add connectat(2) 2020-03-27 05:51:58 +01:00
Mark Johnston
f2e4c4ea82 sys/freebsd: add posix_fadvise(2) and posix_fallocate(2) 2020-03-27 05:51:58 +01:00
Mark Johnston
0645e7c7e9 sys/freebsd: add missing open(2) flags 2020-03-27 05:51:58 +01:00
Mark Johnston
20d6478ce7 sys/freebsd: use symbolic names for faccessat(2) flags 2020-03-27 05:51:58 +01:00
Mark Johnston
7a683c4c28 sys/freebsd: add chflags(2) and related syscalls 2020-03-27 05:51:58 +01:00
Mark Johnston
892d1075a4 sys/freebsd: add lchmod(2) 2020-03-27 05:51:58 +01:00
Mark Johnston
7c5dc2298f sys/freebsd: add copy_file_range(2) 2020-03-27 05:51:58 +01:00
Mark Johnston
31f17aa979 sys/freebsd: add minherit(2) 2020-03-27 05:51:58 +01:00
Mark Johnston
edada2ecad sys/freebsd: add FreeBSD-specific madvise(2) flags 2020-03-27 05:51:58 +01:00
Mark Johnston
0b37813464 sys/freebsd: fix mode for socket_inet_sctp.txt 2020-03-27 05:51:58 +01:00
Dmitry Vyukov
2ab437bb1e prog: improve TestDeserializeHelper
1. Allow to not provide Out if it's the same as In.
2. Always check Out.
2020-03-24 08:43:00 +01:00
Dmitry Vyukov
ef871b2e4f sys/linux: don't use syz_open_dev when openat is enough 2020-03-24 08:43:00 +01:00
Dmitry Vyukov
8cf47975a6 pkg/compiler: truncate const values to their physical size
We do similar truncation for values in the prog package (truncateToBitSize).
Truncating them in the generated descriptions makes it possible
to directly compare values (otherwise -1 and truncated -1 don't match).
2020-03-24 08:43:00 +01:00
Marco Vanotti
aa6c6a5572 sys/fuchsia: Add cprng and vmo tests.
This commit adds two new tests for fuchsia. One tests a basic syscall
(zx_cprng_draw), and the other does multiple tests over a vmo.
2020-03-21 07:02:15 +01:00
Dmitry Vyukov
97bc55cead pkg/compiler: check that flags values fit into base type
flags[foo, int8]
foo = 0x12345678

is always an error, detect these cases.
Found some bugs in mptcp, packet sockets, kvm.
2020-03-17 21:19:13 +01:00
Dmitry Vyukov
2e9037c55f pkg/compiler: check that const values fit into base type
const[0x12345678, int8] is always an error, detect these cases.
Found some bugs in mptcp, socket proto and fuchsia fidl descriptions.
2020-03-17 21:19:13 +01:00
Dmitry Vyukov
80d43738f1 prog: rename target.SanitizeCall to Neutralize
We will need a wrapper for target.SanitizeCall that will do more
than just calling the target-provided function. To avoid confusion
and potential mistakes, give the target function and prog function
different names. Prog package will continue to call this "sanitize",
which will include target's "neutralize" + more.
Also refactor API a bit: we need a helper function that sanitizes
the whole program because that's needed most of the time.

Fixes #477
Fixes #502
2020-03-17 21:19:13 +01:00
Dmitry Vyukov
a2f9a44649 prog: export deserialization test helper for sys/{linux,openbsd}
sys/{linux,openbsd} duplicate deserialization test logic as well.
Export and reuse the existing helper function.
2020-03-17 21:19:13 +01:00
Dmitry Vyukov
1ea952c9ff pkg/compiler: calculate more precise sizes for arguments
If we have:

ioctl(fd fd, cmd int32)
ioctl$FOO(fd fd, cmd const[FOO])

Currently we assume that cmd size in ioctl$FOO is sizeof(void*).
However, we know that in ioctl it's specified as int32,
so we can infer that the actual syscall size is 4.

This massively reduces sizes of socket/setsockopt/getsockopt/ioctl
and some other syscalls, which is good because we now use physical
size in mutation/hints and some other places.

This will also enable not morphing ioctl's into other ioctl's.

Update #477
Update #502
2020-03-17 21:19:13 +01:00
Dmitry Vyukov
924f760604 pkg/compiler: ensure consistency of syscall argument types
Ensure that we don't have conflicting sizes for the same argument
of the same syscall, e.g.:

foo$1(a int16)
foo$2(a int32)

This is useful for several reasons:
 - we will be able avoid morphing syscalls into other syscalls
 - we will be able to figure out more precise sizes for args
   (lots of them are implicitly intptr, which is the largest
   type on most important arches)
 - found few bugs in linux descriptions

Update #477
Update #502
2020-03-17 21:19:13 +01:00
Dmitry Vyukov
5de34a784c pkg/compiler: don't specify syscall consts for test OS
This is just tedious. Fabricate them on the fly.
2020-03-17 21:19:13 +01:00
Andrey Konovalov
d89275f2aa executor, sys/linux: add ath9k usb descriptions
Among other things this changes timeout for USB programs from 2 to 3 seconds.

ath9k fuzzing also requires ath9k firmware to be present, so system images
need to be regenerated with the updated script.
2020-03-13 07:44:43 +01:00
Anton Lindqvist
b655d91b8c sys/openbsd: prevent killing the ssh VM connection
This is one of the root causes of the 'no output from test machine'
panic. Issuing a DIOCKILLSTATES ioctl on a /dev/pf file descriptor will
cause state associated with ongoing connections to be purged;
effectively killing the ssh connection to the VM.

Including net/pfvar.h is necessary in order to make use of the
DIOCKILLSTATES define.
2020-03-05 09:14:28 +01:00
Andrey Konovalov
576fb9bc34 sys, docs: rename syzcall to pseudo-syscall 2020-03-04 19:28:09 +01:00
Anton Lindqvist
09d53fbb27 sys/syz-extract: favor clang on OpenBSD
Clang is the default compiler on amd64 which is the only supported
architecture by syzkaller right now.
2020-03-04 18:27:18 +01:00
Anton Lindqvist
9ef240be5f sys/syz-extract: fix handling of odd prefixed syscalls on OpenBSD
This makes syz-extract work again on OpenBSD.
2020-03-04 18:27:18 +01:00
Anton Lindqvist
4fb7265b97 sys/openbsd: remove unused define 2020-03-04 18:27:18 +01:00
Dmitry Vyukov
2ffa6679c4 sys/linux: add NETLINK_SOCK_DIAG descriptions
Incomplete, but something.
2020-02-21 19:09:56 +01:00
Dmitry Vyukov
4428511d10 sys/linux: add NETLINK_RDMA descriptions 2020-02-21 17:38:10 +01:00
Dmitry Vyukov
ed54dfe305 sys/linux: add NETLINK_AUDIT descriptions 2020-02-21 11:32:08 +01:00
Dmitry Vyukov
82d32c2951 sys/syz-extract: fix output formatting
Remove spaces in the beginning of the message.
The message is actually multi-line and the spaces
are added only before the first line, which makes
the subsequent lines inconsistently offsetted.
2020-02-21 11:19:15 +01:00
Dmitry Vyukov
b6ed147834 prog: dump orig prog if Deserialize panics
We are seeing some one-off panics during Deserialization
and it's unclear if it's machine memory corrpution or
an actual bug in prog. I leam towards machine memory corruption
but it's impossible to prove without seeing the orig program.

Move git revision to prog and it's more base package
(sys can import prog, prog can't import sys).
2020-02-21 10:22:07 +01:00
Dmitry Vyukov
bd2a74a31f sys/linux: add smc_pnetid genetlink descriptions 2020-02-20 18:42:57 +01:00
Dmitry Vyukov
135c18aadb tools: add script that checks copyright headers
Fixes #1604
2020-02-18 16:05:10 +01:00
Dmitry Vyukov
012fbc3229 sys/linux: add descriptions of wireguard packets 2020-02-18 10:31:04 +01:00
Dmitry Vyukov
d52d4872e3 sys/linux: don't extract from futex.txt and watch_queue.txt
These are not present in linux-next.
2020-02-18 10:31:03 +01:00
Dmitry Vyukov
105edea6a3 sys/linux: fix udp test
Fix the packet injection in udp test.
Now we know how to do it!
And without IFF_NAPI_FRAGS it actually reaches the socket.

Update #1594
2020-02-18 10:31:02 +01:00
Dmitry Vyukov
b97f1e694a sys/linux: add broadcast mac address
Code in net/ethernet/eth.c does this:

__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
{
...
	if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
					      dev->dev_addr))) {
		if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) {
			if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast))
				skb->pkt_type = PACKET_BROADCAST;
			else
				skb->pkt_type = PACKET_MULTICAST;
		} else {
			skb->pkt_type = PACKET_OTHERHOST;
		}
	}

Multicast and broadcast are distinct and dev->broadcast seems to be ffffffffffff
by default, so add another multicast mac address that will serve as PACKET_MULTICAST.
2020-02-18 10:31:02 +01:00
André Almeida
d0d8e8bc77
sys/linux: add new FUTEX_WAIT_MULTIPLE operation
Create individual file for futex syscall and add description for the new
operation FUTEX_WAIT_MULTIPLE.

Signed-off-by: André Almeida <andrealmeid@collabora.com>
2020-02-17 06:27:23 +01:00
Paul Chaignon
cf9142006b sys/linux: add map batch operations
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
2020-02-16 10:22:29 +01:00
Paul Chaignon
88f115c969 sys/linux: update BPF constants and structures
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
2020-02-16 10:22:29 +01:00
Dmitry Vyukov
84f4fc8afc sys/linux: add SO_BINDTODEVICE specialization for wireguard
SO_BINDTODEVICE for wg devices allows to reach very important
part of functionality (wg_xmit).

Update #806
2020-02-12 11:50:15 +01:00
Jason A. Donenfeld
4d1ab643be
sys/linux: restrict wireguard allowedips cidr size
By keeping this small, it means much greater probability that a randomly
generated packet that hits xmit will match an existing peer.
2020-02-11 15:12:17 +01:00
Andrey Konovalov
084454aecd dashboard, sys: update USB config 2020-02-11 02:19:31 +01:00
Dmitry Vyukov
d9e55b056e sys/linux/test: add few tests for UDP
Update #1594
2020-02-10 18:35:43 +01:00
Dmitry Vyukov
18847f55bb pkg/ast: introduce hex-encoded string literals
The stringnozescapes does not make sense with filename,
also we may need similar escaping for string flags.
Handle escaped strings on ast level instead.
This avoids introducing new type and works seamleassly with flags.

As alternative I've also tried using strconv.Quote/Unquote
but it leads to ugly half-escaped strings:
"\xb0\x80s\xe8\xd4N\x91\xe3ڒ,\"C\x82D\xbb\x88\\i\xe2i\xc8\xe9\xd85\xb1\x14):M\xdcn"

Make hex-encoded strings a separate string format instead.
2020-02-10 14:45:20 +01:00
Dmitry Vyukov
d0da558cb1 sys/linux: dump netdev_addr_id for wg2
Commit "wireguard: use wg0, wg1, wg2" added wg2,
bump netdev_addr_id accordingly.
2020-02-10 10:52:58 +01:00
Jason A. Donenfeld
b97dee873b pkg/compiler: allow for escaped strings
This adds stringnozescapes to allow parsing of escape sequences in
strings.
2020-02-10 10:51:16 +01:00
Jason A. Donenfeld
4f86d32773 wireguard: use wg0, wg1, wg2
This matches more closely what people are used to dealing with. We also
add one additional device for interesting multi-interface effects.
2020-02-10 10:51:16 +01:00
Jason A. Donenfeld
2c71f1a912 wireguard: increase chance that public and private will correspond
This tests more edge cases, as well as allowing for potentially a
correponding public and private key to be installed.
2020-02-10 10:51:16 +01:00
Christian Brauner
5be3a391ba sys/linux: add new pidfd_getfd syscall
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-02-06 12:38:23 +01:00
Dmitry Vyukov
692266c73a sys/linux: use literal consts instead of hardcoded number 2020-02-01 11:33:32 +01:00
Christoph Paasch
326d4c7836 sys/linux: add IPPROTO_MPTCP support
Adding support for IPPROTO_MPTCP. Like SMC, it is on top of TCP and can
thus be treated like a regular TCP socket.
2020-02-01 11:14:31 +01:00
Dmitry Vyukov
0eb59c2768 sys/linux: regenerate files 2020-01-31 19:31:55 +01:00
Dmitry Vyukov
96ce537b15 sys/linux: add some wireguard descriptions
Update #806
2020-01-31 19:12:16 +01:00
Dmitry Vyukov
d14236bc0a sys/linux: fix drm_mode_fb_cmd2 layout
Thanks to syz-check for catching this.

Update #590
2020-01-28 15:37:49 +01:00
Dmitry Vyukov
5e48183c6e sys/linux: add ethtool netlink descriptions 2020-01-28 15:08:47 +01:00
Dmitry Vyukov
56cd6c9b80 sys/linux: add time namespace descriptions 2020-01-27 15:18:15 +01:00
Dmitry Vyukov
dd56146d26 prog: remove unused ResourceDesc.Type 2020-01-26 11:30:18 +01:00
Dmitry Vyukov
55da6462ff pkg/serializer: do not write field names if it won't save space
If we are going to write all values, don't write field names.
This only increases size of generated files.
The change reduces size of generated files by 5.8%
(62870496-59410354=3460142 bytes saved).
2020-01-26 11:07:18 +01:00
Dmitry Vyukov
f4e7270e33 sys/linux: extend DRM ioctl descriptions
+ disable binderfs (see comments)
+ add few more missing tty ioctls
+ improve few minor things in hci descriptions
2020-01-25 22:30:06 +01:00
Dmitry Vyukov
11ebf937fc sys/linux: restore FOU_ATTR_LOCAL/PEER_V6
They are being fixed in kernel:
https://lists.openwall.net/netdev/2020/01/23/122
2020-01-23 15:05:22 +01:00
Dmitry Vyukov
8d11a11a30 sys/linux: improve infiniband_rdma descriptions 2020-01-23 15:05:21 +01:00
Dmitry Vyukov
0e8428d26f tools/syz-check: add limited checking of varlen structs
Stop at the fist varlen field, but check the preceeding ones.
Frequently the varlen array is the last field,
so we should get good checking for these cases.

Update #590
2020-01-23 15:05:21 +01:00
Dmitry Vyukov
9ab9b329d9 sys/linux: check for missing/duplicate netlink attrs
Update #590
2020-01-23 15:05:20 +01:00
Dmitry Vyukov
46961c2ff5 sys/linux: fix more netlink warnings
Handle NLA_BITFIELD32.
Match string attribtues better.
Calculate and check min size for varlen structs.
Fix NLA_UNSPEC size check.
Fix some things in descriptions.

Update #590
2020-01-23 15:05:19 +01:00
Dmitry Vyukov
3334d684ce sys/linux: fix incorrect nlattr sizes
Update #590
2020-01-22 18:31:20 +01:00
Dmitry Vyukov
f5fe1f1fcf sys/linux: more fixing of netlink policy names
Update #590
2020-01-22 18:31:20 +01:00
Dmitry Vyukov
2bdcee05b5 sys/linux: mark all nested netlink attributes as nlnest
As far as I understand most subsystems don't care about
the nest flag, but some do. But marking them as nest
won't harm (?). Let's mark all of them.

Caught several cases where should have been used array[policy]
but used just policy.

Update #590
2020-01-22 18:31:19 +01:00
Dmitry Vyukov
e4c56f390e tools/syz-check: improve matching netlink attributes
1. Match policies that has a _suffix in our descriptions
(we frequently do this to improve precision or avoid dup names).
2. Rename policies in descriptions to match kernel names.
3. Match policy if there are several such names in kernel.
4. Recognize policies with helper sub-policies.

Update #590
2020-01-22 18:31:15 +01:00
Dmitry Vyukov
010feb8758 sys/linux: add new netlink warnings
Update #590
2020-01-22 12:19:53 +01:00
Dmitry Vyukov
c40da18cc3 sys/linux: fix IFLA_BR_GROUP_ADDR type 2020-01-20 10:29:45 +01:00
Dmitry Vyukov
0342f8c7bc sys/linux: add more device descriptions (geneve, lowpan, ipoib, cfhsi) 2020-01-19 13:51:21 +01:00
Dmitry Vyukov
4668877967 sys/linux: add some batadv descriptions 2020-01-18 21:02:24 +01:00
Dmitry Vyukov
543c012b4e executor: create macvtap, macsec devices 2020-01-18 21:02:24 +01:00
Dmitry Vyukov
22535fecd5 pkg/compiler: don't mark flags with 0 as bitmask
They can't be a bitmask. This fixes important cases
of "0, 1" and "0, 1, 2" flags. Fix some descriptions
that added 0 to bitmasks explicitly (we should do it
automatically instead).
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
d412ea5e8e pkg/compiler: sort flags values
Will simplify runtime analysis of flags.
Also just no reason to make it more deterministic
and avoid unnecessary diffs in future if values are reordered.
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
132dcea0af pkg/compiler: generate const[0] for flags w/o values
Generate const[0] for flags without values and for flags
with a single value which is 0.
This is the intention in all existing cases (e.g. an enum with types
of something, but there is really only 1 type exists).
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
d2f8d5ab46 sys/linux: fix sigset_t/sigaction layout on arm
Update #590
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
773117bf81 tools/syz-check: also check arm/arm64
They mostly duplicate the warnings we already have for amd64/386.
But uncovered few very interesting local things (e.g. epoll_event
is packed only on amd64, so arm/arm64 layout is wrong, but 386
is correct because int64 alignment is different).

Update #590
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
2ec9a3ad9a sys/linux: update warn files
Just regenerate with current descriptions and current linux-next.
Few uninteresting changes.
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
b803944b58 prog: don't add fallback coverage after prctl
The same reason as with seccomp.
2020-01-15 17:35:31 +01:00