FAILED: patch "[PATCH] Input: ims-pcu - fix race condition in reset_device sysfs" failed to apply to 5.10-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 411b8c4b274737c3bf08e1e025801161603cfffc
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026072030-reference-unenvied-28bf@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 411b8c4b274737c3bf08e1e025801161603cfffc Mon Sep 17 00:00:00 2001
From: Dmitry Torokhov <[email protected]>
Date: Fri, 22 May 2026 10:29:04 -0700
Subject: [PATCH] Input: ims-pcu - fix race condition in reset_device sysfs
callback
The ims_pcu_reset_device() sysfs callback calls ims_pcu_execute_command() without acquiring pcu->cmd_mutex. This can lead to data races and corruption of the shared command buffer if triggered concurrently with other commands.
Acquire pcu->cmd_mutex before calling ims_pcu_execute_command().
drivers/input/misc/ims-pcu.c +2 -0
@@ -1153,6 +1153,8 @@ static ssize_t ims_pcu_reset_device(struct device *dev,dev_info (pcu->dev,"Attempting to reset device\n" ); +guard (mutex)(&pcu->cmd_mutex); + error =ims_pcu_execute_command (pcu,PCU_RESET , &reset_byte,1 );if (error) { dev_info(pcu->dev,
Sasha Levin
maintainerPATCH 1/1 Input: ims-pcu - fix race condition in reset_device sysfs callback
From: Dmitry Torokhov <[email protected]>
[ Upstream commit 411b8c4b274737c3bf08e1e025801161603cfffc ]
The ims_pcu_reset_device() sysfs callback calls ims_pcu_execute_command() without acquiring pcu->cmd_mutex. This can lead to data races and corruption of the shared command buffer if triggered concurrently with other commands.
Acquire pcu->cmd_mutex before calling ims_pcu_execute_command().
--- drivers/input/misc/ims-pcu.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/input/misc/ims-pcu.c +2 -0
@@ -1173,6 +1173,8 @@ static ssize_t ims_pcu_reset_device(struct device *dev,dev_info (pcu->dev,"Attempting to reset device\n" ); +guard (mutex)(&pcu->cmd_mutex); + error =ims_pcu_execute_command (pcu,PCU_RESET , &reset_byte,1 );if (error) { dev_info(pcu->dev,
Signature · 1 line
2.53.0