Bug ID: 215759
Summary: KASAN: more OPTIMIZER_HIDE_VAR annotations in tests
Product: Memory Management
Version: 2.5
Kernel Version: upstream
Hardware: All
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: Sanitizers
Assignee: mm_san...@kernel-bugs.kernel.org Reporter: andre...@gmail.com CC: kasa...@googlegroups.com Regression: No
UBSAN, -Wstringop-overflow=, and other compiler features detect the issues
deliberately present in KASAN tests. We need more OPTIMIZER_HIDE_VAR()
annotations.
For example, as reported-by Gustavo A. R. Silva [1]:
lib/test_kasan.c:274:49: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
lib/test_kasan.c:194:63: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
lib/test_kasan.c:139:57: warning: writing 1 byte into a region of size 0
lib/test_kasan.c:145:53: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
lib/test_kasan.c:760:19: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
Peter and Kees also encountered similar issues and sent patches [2, 3], but
looks like those have not been picked up.