r/computerscience • u/Gopiandcoshow • Jul 20 '26
Article Using Verification to Eliminate Bugs in nftables
https://www.basis.ai/blog/verified-nftables/
2
Upvotes
r/computerscience • u/Gopiandcoshow • Jul 20 '26
3
u/trejj Jul 20 '26
The following ruleset drops every packet that has either the SYN flag set, or the ACK flag set:
TCP header has nine bit flags, so this drops packets with
flags=...1.....andflags=.......1., where.means anything, and1means the corresponding bit is set.The following ruleset drops every packet that has exactly SYN flag set (and no other flags), and every packet that has exactly the ACK flag set (and no other flags):
So this drops packets with
flags=00010000andflags=000000010.Then they say that this is an invalid optimizer bug, when the optimizer turned the first into the second.
But holy shit, this does not seem like an optimizer bug, but fundamentally the DSL language for specifying these rules is just busted. Don't fix the optimizer, fix the language syntax.