samples: kmemleak: print the raw pointers for debugging purposesThe kmemleak-test.c module is meant to leak some pointers for debuggingthe kmemleak detection, pointer information dumping. It's no
samples: kmemleak: print the raw pointers for debugging purposesThe kmemleak-test.c module is meant to leak some pointers for debuggingthe kmemleak detection, pointer information dumping. It's no use if itprints the hashed values of such pointers.Change the printk() format from %p to %px. While at it, also display theraw __percpu pointer rather than this_cpu_ptr() since kmemleak now trackssuch pointers independently of the standard allocations.Link: https://lkml.kernel.org/r/[email protected]Signed-off-by: Catalin Marinas <[email protected]>Signed-off-by: Andrew Morton <[email protected]>
show more ...
kmemleak-test: add percpu leakAdd a per-CPU memory leak, which will be reported like:unreferenced object 0x3efa840195f8 (size 64): comm "modprobe", pid 4667, jiffies 4294688677 hex dump (firs
kmemleak-test: add percpu leakAdd a per-CPU memory leak, which will be reported like:unreferenced object 0x3efa840195f8 (size 64): comm "modprobe", pid 4667, jiffies 4294688677 hex dump (first 32 bytes on cpu 0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace (crc 0): [<ffffffffa7fa87af>] pcpu_alloc+0x3df/0x840 [<ffffffffc11642d9>] kmemleak_test_init+0x2c9/0x2f0 [kmemleak_test] [<ffffffffa7c02264>] do_one_initcall+0x44/0x300 [<ffffffffa7de9e10>] do_init_module+0x60/0x240 [<ffffffffa7deb946>] init_module_from_file+0x86/0xc0 [<ffffffffa7deba99>] idempotent_init_module+0x109/0x2a0 [<ffffffffa7debd2a>] __x64_sys_finit_module+0x5a/0xb0 [<ffffffffa88f4f3a>] do_syscall_64+0x7a/0x160 [<ffffffffa8a0012b>] entry_SYSCALL_64_after_hwframe+0x76/0x7eLink: https://lkml.kernel.org/r/[email protected]Signed-off-by: Pavel Tikhomirov <[email protected]>Acked-by: Catalin Marinas <[email protected]>Cc: Alexander Mikhalitsyn <[email protected]>Cc: Chen Jun <[email protected]>Cc: Wei Yongjun <[email protected]>Signed-off-by: Andrew Morton <[email protected]>
kmemleak-test: add missing MODULE_DESCRIPTION() macromake allmodconfig && make W=1 C=1 reports:WARNING: modpost: missing MODULE_DESCRIPTION() in samples/kmemleak/kmemleak-test.oAdd the missing i
kmemleak-test: add missing MODULE_DESCRIPTION() macromake allmodconfig && make W=1 C=1 reports:WARNING: modpost: missing MODULE_DESCRIPTION() in samples/kmemleak/kmemleak-test.oAdd the missing invocation of the MODULE_DESCRIPTION() macro.Link: https://lkml.kernel.org/r/[email protected]Signed-off-by: Jeff Johnson <[email protected]>Acked-by: Catalin Marinas <[email protected]>Signed-off-by: Andrew Morton <[email protected]>
kmemleak-test: drop __init to get better backtraceDrop the __init on kmemleak_test_init(). With it, the storage isreclaimed, but then the symbol isn't available for "%pS" rendering,and the backt
kmemleak-test: drop __init to get better backtraceDrop the __init on kmemleak_test_init(). With it, the storage isreclaimed, but then the symbol isn't available for "%pS" rendering,and the backtrace gets a bare pointer where the actual leak happened.unreferenced object 0xffff88800a2b0800 (size 1024): comm "modprobe", pid 413, jiffies 4294953430 hex dump (first 32 bytes): 73 02 00 00 75 01 00 68 02 00 00 01 00 00 00 04 s...u..h........ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000fabad728>] kmalloc_trace+0x26/0x90 [<00000000ef738764>] 0xffffffffc02350a2 [<00000000004e5795>] do_one_initcall+0x43/0x210 [<00000000d768905e>] do_init_module+0x4a/0x210 [<0000000087135ab5>] __do_sys_finit_module+0x93/0xf0 [<000000004fcb1fa2>] do_syscall_64+0x34/0x80 [<00000000c73c8d9d>] entry_SYSCALL_64_after_hwframe+0x46/0xb0with __init gone, that trace entry renders like: [<00000000ef738764>] kmemleak_test_init+<offset>/<size>Link: https://lkml.kernel.org/r/[email protected]Signed-off-by: Jim Cromie <[email protected]>Acked-by: Catalin Marinas <[email protected]>Signed-off-by: Andrew Morton <[email protected]>
kmemleak-test: fix kmemleak_test.c build logickmemleak-test.c was moved to the samples directory in 1abbef4f51724("mm,kmemleak-test.c: move kmemleak-test.c to samples dir").If CONFIG_DEBUG_KMEML
kmemleak-test: fix kmemleak_test.c build logickmemleak-test.c was moved to the samples directory in 1abbef4f51724("mm,kmemleak-test.c: move kmemleak-test.c to samples dir").If CONFIG_DEBUG_KMEMLEAK_TEST=m and CONFIG_SAMPLES is unset,kmemleak-test.c will be unnecessarily compiled.So move the entry for CONFIG_DEBUG_KMEMLEAK_TEST from mm/Kconfig and add anew CONFIG_SAMPLE_KMEMLEAK in samples/ to control whether kmemleak-test.cis built or not.Link: https://lkml.kernel.org/r/[email protected]Fixes: 1abbef4f51724 ("mm,kmemleak-test.c: move kmemleak-test.c to samples dir")Signed-off-by: Hao Ge <[email protected]>Cc: Catalin Marinas <[email protected]>Cc: Alex Gaynor <[email protected]>Cc: Alex Williamson <[email protected]>Cc: Arnd Bergmann <[email protected]>Cc: Finn Behrens <[email protected]>Cc: Greg Kroah-Hartman <[email protected]>Cc: Jason Gunthorpe <[email protected]>Cc: Mark Rutland <[email protected]>Cc: Miguel Ojeda <[email protected]>Cc: Tony Krowiak <[email protected]>Cc: Ye Xingchen <[email protected]>Signed-off-by: Andrew Morton <[email protected]>
mm,kmemleak-test.c: move kmemleak-test.c to samples dirkmemleak-test.c is just a kmemleak test module, which also can not be usedas a built-in kernel module. Thus, i think it may should not be in
mm,kmemleak-test.c: move kmemleak-test.c to samples dirkmemleak-test.c is just a kmemleak test module, which also can not be usedas a built-in kernel module. Thus, i think it may should not be in mmdir, and move the kmemleak-test.c to samples/kmemleak/kmemleak-test.c.Fix the spelling of built-in by the way.Signed-off-by: Hui Su <[email protected]>Signed-off-by: Andrew Morton <[email protected]>Cc: Catalin Marinas <[email protected]>Cc: Jonathan Corbet <[email protected]>Cc: Mauro Carvalho Chehab <[email protected]>Cc: David S. Miller <[email protected]>Cc: Rob Herring <[email protected]>Cc: Masahiro Yamada <[email protected]>Cc: Sam Ravnborg <[email protected]>Cc: Josh Poimboeuf <[email protected]>Cc: Steven Rostedt (VMware) <[email protected]>Cc: Miguel Ojeda <[email protected]>Cc: Divya Indi <[email protected]>Cc: Tomas Winkler <[email protected]>Cc: David Howells <[email protected]>Link: https://lkml.kernel.org/r/20200925183729.GA172837@rlkSigned-off-by: Linus Torvalds <[email protected]>