Skip to content
Commit bb739796 authored by Aleksa Savic's avatar Aleksa Savic Committed by Greg Kroah-Hartman
Browse files

hwmon: (corsair-cpro) Protect ccp->wait_input_report with a spinlock

[ Upstream commit d02abd57 ]

Through hidraw, userspace can cause a status report to be sent
from the device. The parsing in ccp_raw_event() may happen in
parallel to a send_usb_cmd() call (which resets the completion
for tracking the report) if it's running on a different CPU where
bottom half interrupts are not disabled.

Add a spinlock around the complete_all() in ccp_raw_event() and
reinit_completion() in send_usb_cmd() to prevent race issues.

Fixes: 40c3a445

 ("hwmon: add Corsair Commander Pro driver")
Signed-off-by: default avatarAleksa Savic <savicaleksa83@gmail.com>
Acked-by: default avatarMarius Zachmann <mail@mariuszachmann.de>
Link: https://lore.kernel.org/r/20240504092504.24158-4-savicaleksa83@gmail.com
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 073ca0c2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment