2

I was using kasan first time and got error of following type

==================================================================
BUG: AddressSanitizer: out of bounds access in kmalloc_oob_right+0x65/0x75 [test_kasan] at addr ffff8800693bc5d3
Write of size 1 by task modprobe/1689
=============================================================================
BUG kmalloc-128 (Not tainted): kasan error
-----------------------------------------------------------------------------

Disabling lock debugging due to kernel taint
INFO: Allocated in kmalloc_oob_right+0x3d/0x75 [test_kasan] age=0 cpu=0 pid=1689
 __slab_alloc+0x4b4/0x4f0
 kmem_cache_alloc_trace+0x10b/0x190
 kmalloc_oob_right+0x3d/0x75 [test_kasan]
 init_module+0x9/0x47 [test_kasan]
 do_one_initcall+0x99/0x200
 load_module+0x2cb3/0x3b20
 SyS_finit_module+0x76/0x80
 system_call_fastpath+0x12/0x17
INFO: Slab 0xffffea0001a4ef00 objects=17 used=7 fp=0xffff8800693bd728 flags=0x100000000004080
INFO: Object 0xffff8800693bc558 @offset=1368 fp=0xffff8800693bc720

how to get line number of buggy code from kmalloc_oob_right+0x65/0x75

hdk
  • 21
  • 4
  • You need debug info for the kernel and modules you are debugging. You built those with debug info enabled, right?. To resolve the source lines from the addresses, take a look at addr2line tool from binutils and eu-addr2line from elfutils, these may help. – Eugene Jul 11 '17 at 07:54
  • See also this https://stackoverflow.com/questions/6151538/addr2line-on-kernel-module, may help when debugging kernel modules. – Eugene Jul 11 '17 at 07:59

0 Answers0