summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@kernel.org>2026-07-14 13:56:28 +0100
committerSudeep Holla <sudeep.holla@kernel.org>2026-07-14 21:19:22 +0100
commite6a0e7a49d83e4fa4e1db68d74f99282eb97aa49 (patch)
treea2034c3a8cda956c49404c9e40a8ba5727094452 /drivers
parenta71a3d4d8a6e9e399fd988c0e6da47a6ee21c99e (diff)
downloadlinux-next-e6a0e7a49d83e4fa4e1db68d74f99282eb97aa49.tar.gz
linux-next-e6a0e7a49d83e4fa4e1db68d74f99282eb97aa49.zip
firmware: arm_scmi: Protect device request lookup with RCU
The SCMI device request notifier looks up protocol OF nodes from the active_protocols IDR. The IDR lookup can run concurrently with protocol activation while probe is still registering protocols and creating their SCMI devices. Wrap the lookup in an RCU read-side critical section as required by the IDR API for lockless readers. Fixes: 53b8c25df708 ("firmware: arm_scmi: Add common notifier helpers") Reported-by: Sashiko <sashiko-bot@kernel.org> Link: https://patch.msgid.link/20260714-scmi_core_fixes-v6-9-3afe499d46e3@kernel.org Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/arm_scmi/driver.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index f607557c04ad..a2871dca24dc 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -33,6 +33,7 @@
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/processor.h>
+#include <linux/rcupdate.h>
#include <linux/refcount.h>
#include <linux/slab.h>
#include <linux/xarray.h>
@@ -2958,7 +2959,9 @@ static int scmi_device_request_notifier(struct notifier_block *nb,
struct scmi_device_id *id_table = data;
struct scmi_info *info = req_nb_to_scmi_info(nb);
+ rcu_read_lock();
np = idr_find(&info->active_protocols, id_table->protocol_id);
+ rcu_read_unlock();
if (!np)
return NOTIFY_DONE;