[PATCH] Filter: Fix out-of-range bit access in trie
G'day, This series fixes invalid shifts and out-of-bounds reads in ip4_getbits()/ip6_getbits() for zero-width fields, and in trie_format() for IPv4 /32 and IPv6 /128 nodes. It also fixes ipX_pxlen() misuse in the trie walk test and adds boundary regressions. No intended functional change. Based on master (4bee51c8): https://github.com/randomizedcoder/bird/tree/fix-trie-getbits Tip: eaea2460e7fd0a85458d5564888120b8cd6b715f On Ubuntu 24.04, all 23 test executables pass with and without ASan/UBSan. The new regressions fail without the production fix. Validation: autoreconf -fi ./configure --enable-asan --enable-ubsan make UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1 \ ASAN_OPTIONS=detect_leaks=0:abort_on_error=1 make -k check abort_on_error=1 prevents sanitizer failures from being counted as passes by the forked test harness. LLM tools assisted with the analysis and patches. -- Regards, Dave Seddon +1 415 857 5102
On Sat, Oct 31, 2026 at 03:22:56PM -0700, dave seddon wrote:
G'day,
This series fixes invalid shifts and out-of-bounds reads in ip4_getbits()/ip6_getbits() for zero-width fields, and in trie_format() for IPv4 /32 and IPv6 /128 nodes.
It also fixes ipX_pxlen() misuse in the trie walk test and adds boundary regressions. No intended functional change.
Thanks, merged: https://gitlab.nic.cz/labs/bird/-/commit/07df7ef733eea1ae33dee22b4791699d5a4... -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
dave seddon -
Ondrej Zajicek