rust-vmm / seccompiler

Provides easy-to-use Linux seccomp-bpf jailing.
https://crates.io/crates/seccompiler
Apache License 2.0
70 stars 10 forks source link

Don't install program bigger than 4096 instructions #65

Closed Kijewski closed 10 months ago

Kijewski commented 10 months ago

Summary of the PR

sock_fprog::len is a u16, so a program can have at most 65535 instructions, which is more than plenty. Nevertheless the apply_filter() should return an error if someone calls it with &[sock_filter {...}; 0x10_000] instead of installing an empty filter (0x10000 % 0x10000 == 0).

Requirements

Before submitting your PR, please make sure you addressed the following requirements: