Files
rsync/lib
Andrew Tridgell 3fbee7e407 lib/pool_alloc: fence chunks with an ASan redzone to catch pool underflows
The bump allocator hands out chunks from one big malloc, so AddressSanitizer
cannot see a write that underflows one chunk into its neighbour -- e.g. a
miscomputed F_SUM() that reaches before a file_struct's extras (the
FLAG_HLINKED-without-H bug). Under ASan, poison a small redzone just below
each returned chunk (allocations grow downward from the top of an extent) so
such an underflow becomes a hard use-after-poison report; unpoison a whole
extent whenever its space is reused (reset/reclaim) so legitimate later
allocations never trip over an old redzone. Compiled out entirely without
-fsanitize=address.

Validated: a deliberate write 12 bytes below F_SUM is caught as a
use-after-poison; the existing suite (hardlinks/inc-recurse, daemon, xattrs,
merge) is clean under ASan, so the redzone introduces no false positives.

Also add a require_asan() test helper (mirrors require_tcp) for tests that are
only meaningful under an ASan build.

(cherry picked from commit 402962b7cdea8afb27c0e6e198fef62172c751e3)
2026-06-15 17:15:28 +10:00
..
2020-07-11 11:39:36 -07:00
2022-03-03 17:00:57 -08:00
2020-05-24 22:50:51 -07:00
2019-03-16 09:15:49 -07:00
2006-01-02 17:46:12 +00:00