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] [day] [month] [year] [list]
Message-ID: <Z5camQoZ0KYWvyQ0@gauss3.secunet.de>
Date: Mon, 27 Jan 2025 06:33:13 +0100
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Sebastian Sewior <bigeasy@...utronix.de>
CC: Alexei Starovoitov <alexei.starovoitov@...il.com>, Network Development
	<netdev@...r.kernel.org>
Subject: Re: [PATCH net] xfrm: Don't disable preemption while looking up
 cache state.

On Thu, Jan 23, 2025 at 05:20:45PM +0100, Sebastian Sewior wrote:
> For the state cache lookup xfrm_input_state_lookup() first disables
> preemption, to remain on the CPU and then retrieves a per-CPU pointer.
> Within the preempt-disable section it also acquires
> netns_xfrm::xfrm_state_lock, a spinlock_t. This lock must not be
> acquired with explicit disabled preemption (such as by get_cpu())
> because this lock becomes a sleeping lock on PREEMPT_RT.
> 
> To remain on the same CPU is just an optimisation for the CPU local
> lookup. The actual modification of the per-CPU variable happens with
> netns_xfrm::xfrm_state_lock acquired.
> 
> Remove get_cpu() and use the state_cache_input on the current CPU.
> 
> Reported-by: Alexei Starovoitov <alexei.starovoitov@...il.com>
> Closes: https://lore.kernel.org/all/CAADnVQKkCLaj=roayH=Mjiiqz_svdf1tsC3OE4EC0E=mAD+L1A@mail.gmail.com/
> Fixes: 81a331a0e72dd ("xfrm: Add an inbound percpu state cache.")
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>

Applied to the ipsec tree, thanks a lot Sebastian!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ