Re: [PATCH] gpiolib: synchronize updates of descriptor labels

From: Bartosz Golaszewski

Date: Tue Nov 10 2026 - 05:09:53 EST



On Thu, 05 Nov 2026 14:23:45 +0100, Bartosz Golaszewski wrote:
> desc_set_label() swaps desc->label with rcu_replace_pointer() but
> without any synchronization of concurrent updates. The swap is a plain
> read + write: two threads can observe the same old label and then call
> call_scru() on the same SRCU head corrupting the state of the chain.
>
> Add a spinlock to struct gpio_device - we're using a single spinlock for
> all descriptors as using a per-descriptor lock would unnecessarily bloat
> the size of the desc array with very little chance and no consequences of
> contention - and use it to serialize the pointer update.
>
> [...]

Applied, thanks!

[1/1] gpiolib: synchronize updates of descriptor labels
https://git.kernel.org/brgl/c/82028344caeed2ea3536708906adee02e472633d

Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>