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: <aFLXN5Rbx_egQBeB@lappy>
Date: Wed, 18 Jun 2025 11:11:51 -0400
From: Sasha Levin <sashal@...nel.org>
To: Johan Hovold <johan@...nel.org>
Cc: patches@...ts.linux.dev, stable@...r.kernel.org,
	Brian Norris <briannorris@...omium.org>,
	Thomas Gleixner <tglx@...utronix.de>, matthias.bgg@...il.com,
	angelogioacchino.delregno@...labora.com,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-mediatek@...ts.infradead.org,
	Aleksandrs Vinarskis <alex.vinarskis@...il.com>
Subject: Re: [PATCH AUTOSEL 6.15 092/110] genirq: Retain disable depth for
 managed interrupts across CPU hotplug

On Fri, Jun 06, 2025 at 02:32:29PM +0200, Johan Hovold wrote:
>On Sun, Jun 01, 2025 at 07:24:14PM -0400, Sasha Levin wrote:
>> From: Brian Norris <briannorris@...omium.org>
>>
>> [ Upstream commit 788019eb559fd0b365f501467ceafce540e377cc ]
>>
>> Affinity-managed interrupts can be shut down and restarted during CPU
>> hotunplug/plug. Thereby the interrupt may be left in an unexpected state.
>> Specifically:
>>
>>  1. Interrupt is affine to CPU N
>>  2. disable_irq() -> depth is 1
>>  3. CPU N goes offline
>>  4. irq_shutdown() -> depth is set to 1 (again)
>>  5. CPU N goes online
>>  6. irq_startup() -> depth is set to 0 (BUG! driver expects that the interrupt
>>     		     	      	        still disabled)
>>  7. enable_irq() -> depth underflow / unbalanced enable_irq() warning
>>
>> This is only a problem for managed interrupts and CPU hotplug, all other
>> cases like request()/free()/request() truly needs to reset a possibly stale
>> disable depth value.
>>
>> Provide a startup function, which takes the disable depth into account, and
>> invoked it for the managed interrupts in the CPU hotplug path.
>>
>> This requires to change irq_shutdown() to do a depth increment instead of
>> setting it to 1, which allows to retain the disable depth, but is harmless
>> for the other code paths using irq_startup(), which will still reset the
>> disable depth unconditionally to keep the original correct behaviour.
>>
>> A kunit tests will be added separately to cover some of these aspects.
>>
>> [ tglx: Massaged changelog ]
>>
>> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
>> Signed-off-by: Brian Norris <briannorris@...omium.org>
>> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
>> Link: https://lore.kernel.org/all/20250514201353.3481400-2-briannorris@chromium.org
>> Signed-off-by: Sasha Levin <sashal@...nel.org>
>
>This one breaks suspend of laptops like the Lenovo ThinkPad T14s. Issue
>was just reported here by Alex:
>
>	https://lore.kernel.org/lkml/24ec4adc-7c80-49e9-93ee-19908a97ab84@gmail.com/
>
>Please drop from all stable queues for now.

Will do, thanks!

-- 
Thanks,
Sasha

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ