FAILED: patch "[PATCH] media: rc: Fix race between bpf(BPG_PROG_ATTACH) and device" failed to apply to 6.6-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.6-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-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x b3f5daf3222999d3f92f606a4eb5e35ab90fd0e4
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026110455-abacus-sitting-9c3b@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b3f5daf3222999d3f92f606a4eb5e35ab90fd0e4 Mon Sep 17 00:00:00 2001
From: Sean Young <[email protected]>
Date: Tue, 1 Sep 2026 10:34:51 +0100
Subject: [PATCH] media: rc: Fix race between bpf(BPG_PROG_ATTACH) and device
unregister
Mark the device as unregistered before tearing down raw IR/bpf state, so that racing bpf(BPF_PROG_{ATTACH,DETACH,QUERY}) calls cannot slip in between ir_raw_event_unregister() completing and dev->registered being cleared.
drivers/media/rc/rc-main.c +6 -6
@@ -2056,18 +2056,18 @@ void rc_unregister_device(struct rc_dev *dev)if (!dev)return ; +mutex_lock (&dev->lock); + dev->registered = false; +if (dev->users && dev->close) + dev->close (dev); +mutex_unlock (&dev->lock); +if (dev->driver_type ==RC_DRIVER_IR_RAW )ir_raw_event_unregister (dev);timer_delete_sync (&dev->timer_keyup);timer_delete_sync (&dev->timer_repeat); -mutex_lock (&dev->lock); -if (dev->users && dev->close) - dev->close (dev); - dev->registered = false; -mutex_unlock (&dev->lock); -rc_free_rx_device (dev);/*
Sasha Levin
maintainerPATCH 1/1 media: rc: Fix race between bpf(BPG_PROG_ATTACH) and device unregister
From: Sean Young <[email protected]>
[ Upstream commit b3f5daf3222999d3f92f606a4eb5e35ab90fd0e4 ]
Mark the device as unregistered before tearing down raw IR/bpf state, so that racing bpf(BPF_PROG_{ATTACH,DETACH,QUERY}) calls cannot slip in between ir_raw_event_unregister() completing and dev->registered being cleared.
--- drivers/media/rc/rc-main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/media/rc/rc-main.c +6 -6
@@ -2030,18 +2030,18 @@ void rc_unregister_device(struct rc_dev *dev)if (!dev)return ; +mutex_lock (&dev->lock); + dev->registered = false; +if (dev->users && dev->close) + dev->close (dev); +mutex_unlock (&dev->lock); +if (dev->driver_type ==RC_DRIVER_IR_RAW )ir_raw_event_unregister (dev);del_timer_sync (&dev->timer_keyup);del_timer_sync (&dev->timer_repeat); -mutex_lock (&dev->lock); -if (dev->users && dev->close) - dev->close (dev); - dev->registered = false; -mutex_unlock (&dev->lock); -rc_free_rx_device (dev);/*
Signature · 1 line
2.53.0