Commit Graph

14 Commits

Author SHA1 Message Date
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
Andrey Konovalov
bcd7bcc296 prog: speed up resource ctors detection
When we build a list of resource constructors we over and over iterate through
all types in a syscall to find resource types. Speed it up by iterating only
once to build a list of constructors for each resource and then reuse it.
This significantly speeds up syz-exeprog startup time on Raspberry Pi Zero.
2019-08-30 12:51:28 -07:00
Dmitry Vyukov
da22883527 prog: fix TestTransitivelyEnabledCalls
We now have io_uring on all arches so remove the hack.
2019-05-10 13:04:27 +02:00
Kaipeng Zeng
c2aed7c7e3 sys/linux: update descriptions of sendmsg/sendmmsg
Fix the descriptions of cmsghdr.
Add sendmsg$sock and sendmmsg$sock for __sock_cmsg_send.
2019-05-10 13:00:44 +02:00
Dmitry Vyukov
4f421599f9 sys/linux: add simple io_uring descriptions
We don't actually communicate with the uring yet,
but this already finds a bunch of bugs.
2019-04-12 16:19:23 +02:00
Dmitry Vyukov
c5499485c2 prog: speed up TestResourceCtors
We check each resource multiple times. Check each resource once.
2018-12-31 12:32:14 +01:00
Dmitry Vyukov
dcb1eebb7f prog: more precise constructor calculation
Currently a call that both accepts and creates a resource
self-justifies itself and thus is always enabled.
A good example is accept call. Accepts are always self-enable
and thus enable all other syscalls that work with the socket.

Calculate TransitivelyEnabledCalls in the opposite direction
to resolve this. Start with empty set of enable syscalls,
then enable syscalls that don't accept any resources,
then enable syscalls that accept resources created by the
previous batch of syscalls, and so on.

This prevents self-enablement of accept.
2018-06-18 19:45:48 +02:00
Dmitry Vyukov
9846445c8e prog: parallelize tests
Parallelize more tests and reduce number of iterations
in random tests under race detector.
2018-05-04 20:07:32 +02:00
Dmitry Vyukov
08141db61a gometalinter: enable line length checking
120 columns looks like a reasonable limit
and requires few changes to existing code.

Update #538
2018-05-04 14:24:51 +02:00
Dmitry Vyukov
d169e0f3c4 prog: test TransitivelyEnabledCalls on all targets
Fixes #585
2018-05-03 13:40:21 +02:00
Dmitry Vyukov
2a9c3edcda pkg/prog: explain why syscalls are transitively disabled 2018-04-06 19:43:06 +02:00
Dmitry Vyukov
deb5f6aea2 sys/linux: assorted improvements to descriptions 2017-11-27 09:09:06 +01:00
Dmitry Vyukov
52a33fd516 prog: remove default target and all global state
Now each prog function accepts the desired target explicitly.
No global, implicit state involved.
This is much cleaner and allows cross-OS/arch testing, etc.
2017-09-15 16:02:37 +02:00
Dmitry Vyukov
ffe7e17368 prog, sys: move types to prog
Large overhaul moves syscalls and arg types from sys to prog.
Sys package now depends on prog and contains only generated
descriptions of syscalls.
Introduce prog.Target type that encapsulates all targer properties,
like syscall list, ptr/page size, etc. Also moves OS-dependent pieces
like mmap call generation from prog to sys.

Update #191
2017-09-05 15:52:42 +02:00