summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-11-05 14:23:45 +0100
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-11-10 10:18:48 +0100
commit82028344caeed2ea3536708906adee02e472633d (patch)
treea12e20b2c2ace524a17a24b3d8541fa99b3db6b3 /rust/kernel/alloc
parente20e4b8cda2b4d7dd32dbd2c0875a15d92545f04 (diff)
gpiolib: synchronize updates of descriptor labels
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. Cc: stable@vger.kernel.org Fixes: 1f2bcb8c8ccd ("gpio: protect the descriptor label with SRCU") Closes: https://sashiko.dev/#/bug/linux-2f7ac8b6-5034-4ff1-9afa-5700ff44e3e9 Link: https://patch.msgid.link/20261105-gpiolib-set-desc-label-corruption-v1-1-fa84726ceac0@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions