- Reuse some REDZONE bits to keep track of the requested and allocated
sizes, and use that to provide red zones.
- As in UMA, disable memory trashing to avoid unnecessary CPU overhead.
Details
Details
- Reviewers
- None
- Commits
- rG06a53ecf2400: malloc: Add state transitions for KASAN
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/kern/kern_malloc.c | ||
---|---|---|
912 | For UMA, the region will immediately be marked invalid, so this call isn't really accomplishing anything. Note that in zfree() it is required since we are zeroing the entire allocation, including the redzone. For kmem_*, the region will be marked valid (for future users of the KVA) and unmapped. I think I added this kasan_mark() call before adding state transitions to kmem_*, so I marked the region valid here. Again, it is not necessary now, but is still needed in the zfree() case. | |
1024 | Oops, indeed... |