Re: [syzbot] [media?] possible deadlock in v4l2_ctrl_handler_log_status
From: Hillf Danton
Date: Fri Feb 09 2024 - 03:12:35 EST
On Thu, 08 Feb 2024 01:17:28 -0800
> HEAD commit: b1d3a0e70c38 Add linux-next specific files for 20240208
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1746f9b7e80000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
--- x/drivers/media/v4l2-core/v4l2-ctrls-core.c
+++ y/drivers/media/v4l2-core/v4l2-ctrls-core.c
@@ -2550,7 +2550,7 @@ void v4l2_ctrl_handler_log_status(struct
colon = ": ";
mutex_lock(hdl->lock);
list_for_each_entry(ref, &hdl->ctrl_refs, node) {
- if (ref->from_other_dev ||
+ if (ref->from_other_dev || ref->ctrl->handler != hdl ||
(ref->ctrl->flags & V4L2_CTRL_FLAG_DISABLED))
continue;
log_ctrl(hdl, ref->ctrl, prefix, colon);
--