G'day, Following on from the trie fix, I've been running static analysis and fuzzing over BIRD, and a couple of things turned up. This is the first of them. With cryptographic authentication, rip_check_authentication() takes the position of the authentication trailer from the packet's own length field, and only checks that the data length plus the trailer adds up to the packet length. A packet whose data length is not a whole number of route entries puts the trailer at a misaligned address (UBSan reports a misaligned access reading it), and a data length shorter than the header makes the trailer overlap the header. Such a packet, correctly signed, passes the check and is only dropped later by rip_rx_hook(). The fuzzer found it on the RIP receive path. The fix drops the packet unless the trailer follows the authentication entry and whole route entries. Based on master (4bee51c8): https://github.com/randomizedcoder/bird/tree/fix-rip-auth-tail Tip: de2327d1d182840e7f6b916c4e27b9dce15db60e 66e9f551 Build: Let a test exclude an object from its link ef970101 RIP: Add cryptographic authentication tests de2327d1 RIP: Drop authenticated packets with a misplaced trailer The first commit lets a unit test #include a .c file to reach its static functions, leaving that object out of the test's link. The bridge patch I'm sending alongside this one carries the same commit; whichever goes in second can drop it. The new proto/rip/packets_test.c signs packets with the real rip_fill_authentication() (Keyed MD5 and HMAC-SHA256, with and without the demand circuit header), edits them, and checks rip_check_authentication(): 21 cases covering good packets, wrong key, wrong MAC, bad trailer, old sequence number, the shortest valid packet, and data lengths 1, 2 and 19 bytes off a route entry boundary. The tests are committed first, passing against the current code; the fix then flips only the misaligned cases. All test executables pass with ASan/UBSan, except filter_test and trie_test, which fail the same way on master and are fixed by the trie series. The RIP tests also pass on big-endian s390x under qemu-user. 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 LLM tools assisted with the analysis and patches. -- Regards, Dave Seddon