<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/samples/kmemleak, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-06-09T23:25:40+00:00</updated>
<entry>
<title>kmemleak-test: drop __init to get better backtrace</title>
<updated>2023-06-09T23:25:40+00:00</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2023-05-25T17:43:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dcb8cbb58a218c99aab0dbf3f76cf06a04d44f37'/>
<id>urn:sha1:dcb8cbb58a218c99aab0dbf3f76cf06a04d44f37</id>
<content type='text'>
Drop the __init on kmemleak_test_init().  With it, the storage is
reclaimed, 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:
    [&lt;00000000fabad728&gt;] kmalloc_trace+0x26/0x90
    [&lt;00000000ef738764&gt;] 0xffffffffc02350a2
    [&lt;00000000004e5795&gt;] do_one_initcall+0x43/0x210
    [&lt;00000000d768905e&gt;] do_init_module+0x4a/0x210
    [&lt;0000000087135ab5&gt;] __do_sys_finit_module+0x93/0xf0
    [&lt;000000004fcb1fa2&gt;] do_syscall_64+0x34/0x80
    [&lt;00000000c73c8d9d&gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0

with __init gone, that trace entry renders like:

    [&lt;00000000ef738764&gt;] kmemleak_test_init+&lt;offset&gt;/&lt;size&gt;

Link: https://lkml.kernel.org/r/20230525174356.69711-1-jim.cromie@gmail.com
Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kmemleak-test: fix kmemleak_test.c build logic</title>
<updated>2023-04-18T23:29:47+00:00</updated>
<author>
<name>Hao Ge</name>
<email>gehao@kylinos.cn</email>
</author>
<published>2023-03-30T06:09:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=27d9a0fdb53f05c93ed9c674b870c8add451697e'/>
<id>urn:sha1:27d9a0fdb53f05c93ed9c674b870c8add451697e</id>
<content type='text'>
kmemleak-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 a
new CONFIG_SAMPLE_KMEMLEAK in samples/ to control whether kmemleak-test.c
is built or not.

Link: https://lkml.kernel.org/r/20230330060904.292975-1-gehao@kylinos.cn
Fixes: 1abbef4f51724 ("mm,kmemleak-test.c: move kmemleak-test.c to samples dir")
Signed-off-by: Hao Ge &lt;gehao@kylinos.cn&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Alex Gaynor &lt;alex.gaynor@gmail.com&gt;
Cc: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Finn Behrens &lt;me@kloenk.dev&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Jason Gunthorpe &lt;jgg@ziepe.ca&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Cc: Tony Krowiak &lt;akrowiak@linux.ibm.com&gt;
Cc: Ye Xingchen &lt;ye.xingchen@zte.com.cn&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm,kmemleak-test.c: move kmemleak-test.c to samples dir</title>
<updated>2020-10-14T01:38:27+00:00</updated>
<author>
<name>Hui Su</name>
<email>sh_def@163.com</email>
</author>
<published>2020-10-13T23:48:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1abbef4f51724fb11f09adf0e75275f7cb422a8a'/>
<id>urn:sha1:1abbef4f51724fb11f09adf0e75275f7cb422a8a</id>
<content type='text'>
kmemleak-test.c is just a kmemleak test module, which also can not be used
as a built-in kernel module.  Thus, i think it may should not be in mm
dir, 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 &lt;sh_def@163.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Cc: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Cc: Miguel Ojeda &lt;miguel.ojeda.sandonis@gmail.com&gt;
Cc: Divya Indi &lt;divya.indi@oracle.com&gt;
Cc: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Link: https://lkml.kernel.org/r/20200925183729.GA172837@rlk
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
