malloc: Unmark KASAN redzones if the full allocation size was requested
Consumers that want the full allocation size will typically access the full buffer, so mark the entire allocation as valid to avoid useless KASAN reports. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
032a5bd55b
commit
880b670c6f
@ -1112,6 +1112,13 @@ malloc_usable_size(const void *addr)
|
||||
else
|
||||
size = malloc_large_size(slab);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Unmark the redzone to avoid reports from consumers who are
|
||||
* (presumably) about to use the full allocation size.
|
||||
*/
|
||||
kasan_mark(addr, size, size, 0);
|
||||
|
||||
return (size);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user