<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/samples/kmemleak, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-09-02T03:25:50+00:00</updated>
<entry>
<title>kmemleak-test: add percpu leak</title>
<updated>2024-09-02T03:25:50+00:00</updated>
<author>
<name>Pavel Tikhomirov</name>
<email>ptikhomirov@virtuozzo.com</email>
</author>
<published>2024-07-25T04:12:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0b2fdb352b7991664b23ae5e15b537cd79a7820'/>
<id>urn:sha1:e0b2fdb352b7991664b23ae5e15b537cd79a7820</id>
<content type='text'>
Add 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):
    [&lt;ffffffffa7fa87af&gt;] pcpu_alloc+0x3df/0x840
    [&lt;ffffffffc11642d9&gt;] kmemleak_test_init+0x2c9/0x2f0 [kmemleak_test]
    [&lt;ffffffffa7c02264&gt;] do_one_initcall+0x44/0x300
    [&lt;ffffffffa7de9e10&gt;] do_init_module+0x60/0x240
    [&lt;ffffffffa7deb946&gt;] init_module_from_file+0x86/0xc0
    [&lt;ffffffffa7deba99&gt;] idempotent_init_module+0x109/0x2a0
    [&lt;ffffffffa7debd2a&gt;] __x64_sys_finit_module+0x5a/0xb0
    [&lt;ffffffffa88f4f3a&gt;] do_syscall_64+0x7a/0x160
    [&lt;ffffffffa8a0012b&gt;] entry_SYSCALL_64_after_hwframe+0x76/0x7e

Link: https://lkml.kernel.org/r/20240725041223.872472-3-ptikhomirov@virtuozzo.com
Signed-off-by: Pavel Tikhomirov &lt;ptikhomirov@virtuozzo.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Alexander Mikhalitsyn &lt;aleksandr.mikhalitsyn@canonical.com&gt;
Cc: Chen Jun &lt;chenjun102@huawei.com&gt;
Cc: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kmemleak-test: add missing MODULE_DESCRIPTION() macro</title>
<updated>2024-07-04T02:30:04+00:00</updated>
<author>
<name>Jeff Johnson</name>
<email>quic_jjohnson@quicinc.com</email>
</author>
<published>2024-06-02T01:05:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=656fe3ee455e8d8dfa1c18292c508da26b29a39c'/>
<id>urn:sha1:656fe3ee455e8d8dfa1c18292c508da26b29a39c</id>
<content type='text'>
make allmodconfig &amp;&amp; make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in samples/kmemleak/kmemleak-test.o

Add the missing invocation of the MODULE_DESCRIPTION() macro.

Link: https://lkml.kernel.org/r/20240601-md-samples-kmemleak-v1-1-47186be7f0a8@quicinc.com
Signed-off-by: Jeff Johnson &lt;quic_jjohnson@quicinc.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: 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>
