16 Commits
Author SHA1 Message Date
Etienne PerotandgVisor bot 7cf14b7c8b Add equality function for BPF instructions.
Use it when checking that instructions are equivalent in
`rewriteAllJumpsToReturn`.

Reported-by: syzbot+637101fb08769773300e@syzkaller.appspotmail.com
PiperOrigin-RevId: 585802467
2023-11-27 17:18:02 -08:00
Etienne PerotandgVisor bot 201a046299 seccomp: Enforce that Sentry filters match against reference program.
This change adds a `filter_fuzz_golden.bpf` BPF program that was generated
manually prior to my recent set of changes to seccomp bytecode and rule
optimization changes. It represents the "reference logic"; the new test
verifies that the current seccomp-bpf library produces BPF bytecode that
has the same behavior, using fuzz testing with full line-based coverage.

PiperOrigin-RevId: 582914572
2023-11-15 22:38:00 -08:00
Etienne PerotandgVisor bot 9ff4c45938 bpf: Implement BPF optimizer.
This performs a few lossless optimizations passes over BPF programs.

This change does minimal testing and does not test for correctness.
The next change incorporates this optimizer in the program builder which *is*
tested for correctness.

It is not used anywhere yet, but when putting it on the Sentry filters:

```
                                   │    before     │                    opt                    │
                                   │    sec/op     │    sec/op     vs base                     │
SentrySystrap/Postgres/futex          88.82n ±  2%   81.29n ±  2%   -8.48% (p=0.000 n=519+510)
SentrySystrap/Postgres/nanosleep      116.9n ± 19%   115.9n ± 17%        ~ (p=0.859 n=350+317)
SentrySystrap/Postgres/sendmmsg       88.68n ±  1%   81.56n ±  1%   -8.04% (n=519+510)
SentrySystrap/Postgres/fstat          24.47n ±  3%   24.31n ±  6%        ~ (p=0.832 n=514+502)
[...]
SentrySystrap/Postgres-48             71.00n ±  8%   63.00n ±  6%  -11.27% (p=0.002 n=183+181)
```

PiperOrigin-RevId: 570900358
2023-10-04 21:48:35 -07:00
Etienne PerotandgVisor bot 5f5692dd20 bpf: Replace most uses of linux.BPFInstruction with bpf.Instruction.
`bpf.Instruction` is the same type as `linux.BPFInstruction`, except that it
uses the BPF instruction-to-string decoder to give a nice human-readable
stringification.

PiperOrigin-RevId: 570499020
2023-10-03 14:34:53 -07:00
Adin ScannellandgVisor bot 1ceb814544 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Rahat MahmoodandgVisor bot e00bd82816 Remove uses of the binary package from the rest of the sentry.
PiperOrigin-RevId: 372020696
2021-05-04 16:41:08 -07:00
Adin ScannellandgVisor bot d29e59af9f Standardize on tools directory.
PiperOrigin-RevId: 291745021
2020-01-27 12:21:00 -08:00
Kevin KrakauerandgVisor bot 2a82d5ad68 Reorder BUILD license and load functions in gvisor.
PiperOrigin-RevId: 275139066
2019-10-16 16:40:30 -07:00
Michael PrattandgVisor bot df5d377521 Remove go_test from go_stateify and go_marshal
They are no-ops, so the standard rule works fine.

PiperOrigin-RevId: 268776264
2019-09-12 15:10:17 -07:00
Adin ScannellandShentubot add40fd6ad Update canonical repository.
This can be merged after:
https://github.com/google/gvisor-website/pull/77
  or
https://github.com/google/gvisor-website/pull/78

PiperOrigin-RevId: 253132620
2019-06-13 16:50:15 -07:00
Michael PrattandShentubot 2a0c69b19f Remove license comments
Nothing reads them and they can simply get stale.

Generated with:
$ sed -i "s/licenses(\(.*\)).*/licenses(\1)/" **/BUILD

PiperOrigin-RevId: 231818945
Change-Id: Ibc3f9838546b7e94f13f217060d31f4ada9d4bf0
2019-01-31 11:12:53 -08:00
Zhaozhong NiandShentubot 57d0fcbdbf Automated rollback of changelist 207037226
PiperOrigin-RevId: 207125440
Change-Id: I6c572afb4d693ee72a0c458a988b0e96d191cd49
2018-08-02 10:42:48 -07:00
Michael PrattandShentubot 60add78980 Automated rollback of changelist 207007153
PiperOrigin-RevId: 207037226
Change-Id: I8b5f1a056d4f3eab17846f2e0193bb737ecb5428
2018-08-01 19:57:32 -07:00
Zhaozhong NiandShentubot b9e1cf8404 stateify: convert all packages to use explicit mode.
PiperOrigin-RevId: 207007153
Change-Id: Ifedf1cc3758dc18be16647a4ece9c840c1c636c9
2018-08-01 15:43:24 -07:00
Zhaozhong NiandShentubot be7fcbc558 stateify: support explicit annotation mode; convert refs and stack packages.
We have been unnecessarily creating too many savable types implicitly.

PiperOrigin-RevId: 206334201
Change-Id: Idc5a3a14bfb7ee125c4f2bb2b1c53164e46f29a8
2018-07-27 10:17:21 -07:00
GooglerandAdin Scannell d02b74a5dc Check in gVisor.
PiperOrigin-RevId: 194583126
Change-Id: Ica1d8821a90f74e7e745962d71801c598c652463
2018-04-28 01:44:26 -04:00