aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/init_iptables.go
Commit message (Collapse)AuthorAgeFilesLines
* sys/linux: clone args before mutationAleksandr Nogikh2024-03-131-2/+2
| | | | | | | | Not cloning the argument results in replaceArg() replacing a union argument with itself, which may lead to inconsistent resource references. Add an assertion to detect such cases in the future.
* Revert "sys/linux: clone args before mutation"Aleksandr Nogikh2024-03-081-2/+2
| | | | This reverts commit 4097c8d7a8596ddbc9a9db7b7f39c5cbdb1bd742.
* sys/linux: clone args before mutationAleksandr Nogikh2024-03-081-2/+2
| | | | | | | | Not cloning the argument results in replaceArg() replacing a union argument with itself, which may lead to inconsistent resource references. Add an assertion to detect such cases in the future.
* prog: remove Dir from TypeDmitry Vyukov2020-05-011-8/+8
| | | | | | | | | | | | | | | | | | 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
* prog: rename target.SanitizeCall to NeutralizeDmitry Vyukov2020-03-171-1/+1
| | | | | | | | | | | | | 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
* prog: add concept of "special pointers"Dmitry Vyukov2018-08-301-1/+11
| | | | | | | | | | | | | | | | | Currently we only generate either valid user-space pointers or NULL. Extend NULL to a set of special pointers that we will use in programs. All targets now contain 3 special values: - NULL - 0xfffffffffffffff (invalid kernel pointer) - 0x999999999999999 (non-canonical address) Each target can add additional special pointers on top of this. Also generate NULL/special pointers for non-opt ptr's. This restriction was always too restrictive. We may want to generate them with very low probability, but we do want to generate them. Also change pointers to NULL/special during mutation (but still not in the opposite direction).
* all: fix gometalinter warningsDmitry Vyukov2018-03-081-2/+1
| | | | Fix typos, non-canonical code, remove dead code, etc.
* prog: add arbitrary mutation of complex structsDmitry Vyukov2018-02-251-0/+4
| | | | | | Squash complex structs into flat byte array and mutate this array with generic blob mutations. This allows to mutate what we currently consider as paddings and add/remove paddings from structs, etc.
* prog: rework foreachArgDmitry Vyukov2018-02-191-1/+1
| | | | | | | | Make Foreach* callback accept the arg and a context struct that can contain lots of aux info. This (1) removes lots of unuser base/parent args, (2) provides foundation for stopping recursion, (3) allows to merge foreachSubargOffset.
* sys/linux: add bridge netfilter supportDmitry Vyukov2018-02-171-0/+61
|
* sys/linux: improve netfilter descriptionsDmitry Vyukov2018-02-091-12/+49
| | | | | | | | | | | | | | | | Put the underflow entry at the end. Entries must end on an unconditional, non-goto entry, otherwise fallthrough from the last entry is invalid. Add arp tables support. Split unspec matches/targets to unspec and inet. Reset ipv6 and arp tables in executor. Fix number of counters in tables. Plus a bunch of assorted fixes for matches/targets.
* sys/linux: extend netfilter descriptionsDmitry Vyukov2018-01-271-0/+71