Bug 212207

Summary: KASAN: precise redzone checks in tests
Product: Memory Management Reporter: Andrey Konovalov (andreyknvl)
Component: SanitizersAssignee: MM/Sanitizers virtual assignee (mm_sanitizers)
Status: NEW ---    
Severity: normal CC: kasan-dev
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: upstream Subsystem:
Regression: No Bisected commit-id:

Description Andrey Konovalov 2021-03-09 16:46:47 UTC
It makes sense to add precise checks for redzones in kmalloc() KASAN tests. I.e. make sure that the first and last byte of allocated memory are accessible, and that the first and the last bytes of the attached redzone is inaccessible.

Currently, this is only implemented for krealloc() tests.

The implementation needs to account that tag-based KASAN modes round up allocation size to KASAN_GRANULE_SIZE.
Comment 1 Andrey Konovalov 2021-03-09 16:47:52 UTC
The same can be done with stack/global tests and perhaps some of the others.