<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/kcsan, branch v6.18</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.18</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.18'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-10-02T15:31:44Z</updated>
<entry>
<title>Merge tag 'kcsan-20250929-v6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/melver/linux</title>
<updated>2025-10-02T15:31:44Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-10-02T15:31:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d7a018eb761f44f1f48667540185d025354f33b6'/>
<id>urn:sha1:d7a018eb761f44f1f48667540185d025354f33b6</id>
<content type='text'>
Pull Kernel Concurrency Sanitizer (KCSAN) update from Marco Elver:

 - Replace deprecated strcpy() with strscpy()

* tag 'kcsan-20250929-v6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/melver/linux:
  kcsan: test: Replace deprecated strcpy() with strscpy()
</content>
</entry>
<entry>
<title>kunit: Pass parameterized test context to generate_params()</title>
<updated>2025-08-27T05:36:03Z</updated>
<author>
<name>Marie Zhussupova</name>
<email>marievic@google.com</email>
</author>
<published>2025-08-26T09:13:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b9a214b5f6aa55870b5678f31084f85c0c11ffdc'/>
<id>urn:sha1:b9a214b5f6aa55870b5678f31084f85c0c11ffdc</id>
<content type='text'>
To enable more complex parameterized testing scenarios, the
generate_params() function needs additional context beyond just
the previously generated parameter. This patch modifies the
generate_params() function signature to include an extra
`struct kunit *test` argument, giving test users access to the
parameterized test context when generating parameters.

The `struct kunit *test` argument was added as the first parameter
to the function signature as it aligns with the convention of other
KUnit functions that accept `struct kunit *test` first. This also
mirrors the "this" or "self" reference found in object-oriented
programming languages.

This patch also modifies xe_pci_live_device_gen_param() in xe_pci.c
and nthreads_gen_params() in kcsan_test.c to reflect this signature
change.

Link: https://lore.kernel.org/r/20250826091341.1427123-4-davidgow@google.com
Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Reviewed-by: Rae Moar &lt;rmoar@google.com&gt;
Acked-by: Marco Elver &lt;elver@google.com&gt;
Acked-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt;
Signed-off-by: Marie Zhussupova &lt;marievic@google.com&gt;
[Catch some additional gen_params signatures in drm/xe/tests --David]
Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kcsan: test: Replace deprecated strcpy() with strscpy()</title>
<updated>2025-08-19T10:52:12Z</updated>
<author>
<name>Thorsten Blum</name>
<email>thorsten.blum@linux.dev</email>
</author>
<published>2025-08-15T21:37:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=800348aa34b2bc40d558bb17b6719c51fac0b6de'/>
<id>urn:sha1:800348aa34b2bc40d558bb17b6719c51fac0b6de</id>
<content type='text'>
strcpy() is deprecated; use strscpy() instead.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum &lt;thorsten.blum@linux.dev&gt;
Reviewed-by: Justin Stitt &lt;justinstitt@google.com&gt;
Signed-off-by: Marco Elver &lt;elver@google.com&gt;
</content>
</entry>
<entry>
<title>kcsan: test: Initialize dummy variable</title>
<updated>2025-07-23T06:51:32Z</updated>
<author>
<name>Marco Elver</name>
<email>elver@google.com</email>
</author>
<published>2025-07-22T18:19:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9872916ad1a1a5e7d089e05166c85dbd65e5b0e8'/>
<id>urn:sha1:9872916ad1a1a5e7d089e05166c85dbd65e5b0e8</id>
<content type='text'>
Newer compiler versions rightfully point out:

 kernel/kcsan/kcsan_test.c:591:41: error: variable 'dummy' is
 uninitialized when passed as a const pointer argument here
 [-Werror,-Wuninitialized-const-pointer]
   591 |         KCSAN_EXPECT_READ_BARRIER(atomic_read(&amp;dummy), false);
       |                                                ^~~~~
 1 error generated.

Although this particular test does not care about the value stored in
the dummy atomic variable, let's silence the warning.

Link: https://lkml.kernel.org/r/CA+G9fYu8JY=k-r0hnBRSkQQrFJ1Bz+ShdXNwC1TNeMt0eXaxeA@mail.gmail.com
Fixes: 8bc32b348178 ("kcsan: test: Add test cases for memory barrier instrumentation")
Reported-by: Linux Kernel Functional Testing &lt;lkft@linaro.org&gt;
Reviewed-by: Alexander Potapenko &lt;glider@google.com&gt;
Signed-off-by: Marco Elver &lt;elver@google.com&gt;
</content>
</entry>
<entry>
<title>treewide, timers: Rename destroy_timer_on_stack() as timer_destroy_on_stack()</title>
<updated>2025-05-08T17:49:33Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2025-05-07T17:53:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aad823aa3a7d675a8d0de478a04307f63e3725db'/>
<id>urn:sha1:aad823aa3a7d675a8d0de478a04307f63e3725db</id>
<content type='text'>
Move this API to the canonical timer_*() namespace.

Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/all/20250507175338.672442-10-mingo@kernel.org

</content>
</entry>
<entry>
<title>treewide: Switch/rename to timer_delete[_sync]()</title>
<updated>2025-04-05T08:30:12Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2025-04-05T08:17:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8fa7292fee5c5240402371ea89ab285ec856c916'/>
<id>urn:sha1:8fa7292fee5c5240402371ea89ab285ec856c916</id>
<content type='text'>
timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree
over and remove the historical wrapper inlines.

Conversion was done with coccinelle plus manual fixups where necessary.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>kcsan: Remove redundant call of kallsyms_lookup_name()</title>
<updated>2024-10-14T14:44:56Z</updated>
<author>
<name>Ran Xiaokai</name>
<email>ran.xiaokai@zte.com.cn</email>
</author>
<published>2024-09-25T14:31:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b86f7c9fad06b960f3ac5594cb3838a7eaeb1892'/>
<id>urn:sha1:b86f7c9fad06b960f3ac5594cb3838a7eaeb1892</id>
<content type='text'>
There is no need to repeatedly call kallsyms_lookup_name, we can reuse
the return value of this function.

Signed-off-by: Ran Xiaokai &lt;ran.xiaokai@zte.com.cn&gt;
Signed-off-by: Marco Elver &lt;elver@google.com&gt;
</content>
</entry>
<entry>
<title>kcsan: Turn report_filterlist_lock into a raw_spinlock</title>
<updated>2024-10-14T14:44:48Z</updated>
<author>
<name>Marco Elver</name>
<email>elver@google.com</email>
</author>
<published>2024-10-01T14:00:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59458fa4ddb47e7891c61b4a928d13d5f5b00aa0'/>
<id>urn:sha1:59458fa4ddb47e7891c61b4a928d13d5f5b00aa0</id>
<content type='text'>
Ran Xiaokai reports that with a KCSAN-enabled PREEMPT_RT kernel, we can see
splats like:

| BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
| in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1
| preempt_count: 10002, expected: 0
| RCU nest depth: 0, expected: 0
| no locks held by swapper/1/0.
| irq event stamp: 156674
| hardirqs last  enabled at (156673): [&lt;ffffffff81130bd9&gt;] do_idle+0x1f9/0x240
| hardirqs last disabled at (156674): [&lt;ffffffff82254f84&gt;] sysvec_apic_timer_interrupt+0x14/0xc0
| softirqs last  enabled at (0): [&lt;ffffffff81099f47&gt;] copy_process+0xfc7/0x4b60
| softirqs last disabled at (0): [&lt;0000000000000000&gt;] 0x0
| Preemption disabled at:
| [&lt;ffffffff814a3e2a&gt;] paint_ptr+0x2a/0x90
| CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Not tainted 6.11.0+ #3
| Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org 04/01/2014
| Call Trace:
|  &lt;IRQ&gt;
|  dump_stack_lvl+0x7e/0xc0
|  dump_stack+0x1d/0x30
|  __might_resched+0x1a2/0x270
|  rt_spin_lock+0x68/0x170
|  kcsan_skip_report_debugfs+0x43/0xe0
|  print_report+0xb5/0x590
|  kcsan_report_known_origin+0x1b1/0x1d0
|  kcsan_setup_watchpoint+0x348/0x650
|  __tsan_unaligned_write1+0x16d/0x1d0
|  hrtimer_interrupt+0x3d6/0x430
|  __sysvec_apic_timer_interrupt+0xe8/0x3a0
|  sysvec_apic_timer_interrupt+0x97/0xc0
|  &lt;/IRQ&gt;

On a detected data race, KCSAN's reporting logic checks if it should
filter the report. That list is protected by the report_filterlist_lock
*non-raw* spinlock which may sleep on RT kernels.

Since KCSAN may report data races in any context, convert it to a
raw_spinlock.

This requires being careful about when to allocate memory for the filter
list itself which can be done via KCSAN's debugfs interface. Concurrent
modification of the filter list via debugfs should be rare: the chosen
strategy is to optimistically pre-allocate memory before the critical
section and discard if unused.

Link: https://lore.kernel.org/all/20240925143154.2322926-1-ranxiaokai627@163.com/
Reported-by: Ran Xiaokai &lt;ran.xiaokai@zte.com.cn&gt;
Tested-by: Ran Xiaokai &lt;ran.xiaokai@zte.com.cn&gt;
Signed-off-by: Marco Elver &lt;elver@google.com&gt;
</content>
</entry>
<entry>
<title>kcsan: Use min() to fix Coccinelle warning</title>
<updated>2024-08-01T23:40:44Z</updated>
<author>
<name>Thorsten Blum</name>
<email>thorsten.blum@toblux.com</email>
</author>
<published>2024-06-24T17:57:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=43d631bf06ec961bbe4c824b931fe03be44c419c'/>
<id>urn:sha1:43d631bf06ec961bbe4c824b931fe03be44c419c</id>
<content type='text'>
Fixes the following Coccinelle/coccicheck warning reported by
minmax.cocci:

	WARNING opportunity for min()

Use const size_t instead of int for the result of min().

Compile-tested with CONFIG_KCSAN=y.

Reviewed-by: Marco Elver &lt;elver@google.com&gt;
Signed-off-by: Thorsten Blum &lt;thorsten.blum@toblux.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>kcsan: Add missing MODULE_DESCRIPTION() macro</title>
<updated>2024-06-06T18:21:14Z</updated>
<author>
<name>Jeff Johnson</name>
<email>quic_jjohnson@quicinc.com</email>
</author>
<published>2024-05-30T19:39:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ddd7432d621daf93baf36e353ab7472d69dd692f'/>
<id>urn:sha1:ddd7432d621daf93baf36e353ab7472d69dd692f</id>
<content type='text'>
Fix the warning reported by 'make C=1 W=1':
WARNING: modpost: missing MODULE_DESCRIPTION() in kernel/kcsan/kcsan_test.o

Signed-off-by: Jeff Johnson &lt;quic_jjohnson@quicinc.com&gt;
Reviewed-by: Marco Elver &lt;elver@google.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
</feed>
