Bug 198435

Summary: KASAN: print frame description for stack bugs
Product: Memory Management Reporter: Dmitry Vyukov (dvyukov)
Component: SanitizersAssignee: Dmitry Vyukov (dvyukov)
Status: RESOLVED CODE_FIX    
Severity: normal CC: kasan-dev, melver
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: ALL Subsystem:
Regression: No Bisected commit-id:

Description Dmitry Vyukov 2018-01-10 14:21:25 UTC
We currently don't print info about stack frame as asan does. We should.
Here is a quick prototype ftr:
https://groups.google.com/d/msg/kasan-dev/iDb5bhcMBT0/55QzwWaHAwAJ

We probably need to put this code into print_address_description().
For current task is it relatively simple, we can use task_stack_page() to get current stack range and it won't change under us.
For other tasks, first we need to figure out a way to find the corresponding task (which may not be possible due to deadlocks), and then try_get_task_stack(). But still stack can change under us, so info won't be reliable.

FTR, interface documentation is in AsanThread::GetStackFrameAccessByAddr and ParseFrameDescription asan function.
Comment 1 Marco Elver 2019-05-27 13:00:39 UTC
Patch implementing this has been added to mm-tree:
https://lkml.org/lkml/2019/5/22/224