lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4cfe2276.2c0da.1973ff1cc40.Coremail.chenglingfei22s@ict.ac.cn>
Date: Thu, 5 Jun 2025 19:55:00 +0800 (GMT+08:00)
From: chenglingfei <chenglingfei22s@....ac.cn>
To: "Sven Peter" <sven@...nel.org>
Cc: j@...nau.net, alyssa@...enzweig.io, neal@...pa.dev, 
	zhangzhenwei22b@....ac.cn, wangzhe12@....ac.cn, maddy@...ux.ibm.com, 
	mpe@...erman.id.au, npiggin@...il.com, christophe.leroy@...roup.eu, 
	naveen@...nel.org, andi.shyti@...nel.org, asahi@...ts.linux.dev, 
	linux-arm-kernel@...ts.infradead.org, linuxppc-dev@...ts.ozlabs.org, 
	linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: Re: [BUG] rmmod i2c-pasemi-platform causing kernel crash on
 Apple M1.




&gt; -----原始邮件-----
&gt; 发件人: "Sven Peter" <sven@...nel.org>
&gt; 发送时间: 2025-06-05 18:25:09 (星期四)
&gt; 收件人: 程凌飞 <chenglingfei22s@....ac.cn>, j@...nau.net, alyssa@...enzweig.io, neal@...pa.dev
&gt; 抄送: zhangzhenwei22b@....ac.cn, wangzhe12@....ac.cn, maddy@...ux.ibm.com, mpe@...erman.id.au, npiggin@...il.com, christophe.leroy@...roup.eu, naveen@...nel.org, andi.shyti@...nel.org, asahi@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org, linuxppc-dev@...ts.ozlabs.org, linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
&gt; 主题: Re: [BUG] rmmod i2c-pasemi-platform causing kernel crash on Apple M1.
&gt; 
&gt; Hi,
&gt; 
&gt; On 05.06.25 05:02, 程凌飞 wrote:
&gt; &gt; Hi, all!
&gt; &gt; 
&gt; &gt; We’ve encountered a kernel crash when running rmmod i2c-pasemi-platform on a Mac Mini M1 (T8103) running Asahi Arch Linux.
&gt; &gt; 
&gt; &gt; The bug was first found on the Linux v6.6, which is built manually with the Asahi given config to run our services.
&gt; &gt; At that time, the i2c-pasemi-platform was i2c-apple.
&gt; &gt; 
&gt; &gt; We noticed in the Linux v6.7, the pasemi is splitted into two separate modules, one of which is i2c-pasemi-platform.
&gt; &gt; Therefore, we built Linux v6.14.6 and tried to rmmod i2c-pasemi-platform again, the crash still exists. Moreover, we fetched
&gt; &gt; the latest i2c-pasemi-platform on linux-next(911483b25612c8bc32a706ba940738cc43299496) and asahi, built them and
&gt; &gt; tested again with Linux v6.14.6, but the crash remains.
&gt; &gt; 
&gt; &gt; Because kexec is not supported and will never be fully supported on Apple Silicon platforms due to hardware and firmware
&gt; &gt; design constraints, we can not record the panic logs through kdump.
&gt; 
&gt; Do you have UART connected to a device under test which you could use to 
&gt; grab the panic log from the kernel? Alternatively you can also run the 
&gt; kernel under m1n1's hypervisor and grab the log that way. It'll emulate 
&gt; the serial port and redirect its output via USB.
&gt; 

I don't have UART, but I have tried to run the kernel under m1n1's hypervisor. However, it does not trigger the release of cs42l83. 
Given that m1n1 provides full peripheral device emulation capability, the most plausible explanation would be an incorrect 
firmware loading sequence. But the documentation of Asahi provides little details about how to generate an initramfs with 
firmware (I think), can you give more guidance about it?

&gt; &gt; 
&gt; &gt; Thus we tried to find the root cause of the issue manually. When we perform rmmod, the kernel performs device releasing on
&gt; &gt; the i2c bus, then calls the remove function in snd-soc-cs42l83-i2c, which calls the cs42l42_common_remove in cs42l42,
&gt; &gt; because cs42l42-&gt;init_done is true, it performs regmap_write, and finally calls into pasemi_smb_waitready in i2c-pasemi
&gt; &gt; -core.c. We noticed that smbus-&gt;use_irq is true, and after it calls into wait_for_completion_timeout, the system crashs!&gt;
&gt; &gt; We found that wait_for_completion_timeout is one of the core scheduler APIs used by tens of thousands of other drivers,
&gt; &gt; it is unlikely causing the crash. So we tried to remove the call to wait_for_completion_timeout, then the system seems to
&gt; &gt; run well.
&gt; &gt; 
&gt; &gt; However, because we have little knowledge about i2c devices and specifications, we are not sure whether this change will
&gt; &gt; cause other potential harms for the system and device. Is this call to wait necesary here? Or can you give a more
&gt; &gt; sophisticated fix?
&gt; 
&gt; Yes, that call is necessary. It waits for the "transfer completed" 
&gt; interrupt from the hardware. Without it the driver will try to read data 
&gt; before it's available and you'll see corruption. I'm surprised hardware 
&gt; attached to i2c (usb pd controller and audio I think) works at all with 
&gt; that change.
&gt; 
&gt; 
&gt; Sven

Are there any methods or tools to systematically verify its functionality? I am not sure whether the devices attached to i2c
should work well even after the i2c-pasemi-platform has been removed.
</chenglingfei22s@....ac.cn></sven@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ