Bug 213719

Summary: KASAN: don't corrupt memory in tests
Product: Memory Management Reporter: Andrey Konovalov (andreyknvl)
Component: SanitizersAssignee: MM/Sanitizers virtual assignee (mm_sanitizers)
Status: RESOLVED CODE_FIX    
Severity: normal CC: kasan-dev
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: upstream Subsystem:
Regression: No Bisected commit-id:
Attachments: kasan: don't do invalid writes in tests

Description Andrey Konovalov 2021-07-13 17:59:47 UTC
Created attachment 297829 [details]
kasan: don't do invalid writes in tests

Currently, some of KASAN tests do out-of-bounds of use-after-free writes. As KASAN doesn't suppress invalid memory accesses, they can lead to kernel crashes while executing tests.

We should rework the tests to avoid making write accesses outside of redzones and alignment areas.

A draft fix is attached. The draft addresses the tests that I observed corrupting memory in my setup, but there are more tests to be fixed.
Comment 2 Andrey Konovalov 2021-11-14 21:23:29 UTC
This is resolved.