@@ -724,26 +724,24 @@ freeing as there would be if the kernel supported these features directly.
724724
725725## Memory tagging
726726
727- Random tags are set for all slab allocations when allocated, with 5 excluded values:
727+ Random tags are set for all slab allocations when allocated, with 4 excluded values:
728728
729- 1 . the default ` 0 ` tag
730- 2 . a statically * reserved free tag*
731- 3 . the previous tag used for the slot
732- 4 . the current (or previous) tag used for the slot to the left
733- 5 . the current (or previous) tag used for the slot to the right
729+ 1 . the reserved ` 0 ` tag
730+ 2 . the previous tag used for the slot
731+ 3 . the current (or previous) tag used for the slot to the left
732+ 4 . the current (or previous) tag used for the slot to the right
734733
735- When a slab allocation is freed, the * reserved free tag* is set for the slot.
734+ When a slab allocation is freed, the reserved ` 0 ` tag is set for the slot.
735+ Slab allocation slots are cleared before reuse when memory tagging is enabled.
736736
737737This ensures the following properties:
738738
739739- Linear overflows are deterministically detected.
740740- Use-after-free are deterministically detected until the freed slot goes through
741741 both the random and FIFO quarantines, gets allocated again, goes through both
742742 quarantines again and then finally gets allocated again for a 2nd time.
743- Since the default ` 0 ` tag isn't used, untagged memory can't access malloc allocations
744- and vice versa, although it may make sense to reuse the default tag for free
745- data to avoid reducing the possible random tags from 15 to 14, since freed
746- data is always zeroed anyway.
743+ - Since the default ` 0 ` tag is reserved, untagged pointers can't access slab
744+ allocations and vice versa.
747745
748746Slab allocations are done in a statically reserved region for each size class
749747and all metadata is in a statically reserved region, so interactions between
0 commit comments