From: Wei Jie LAW <98lawweijie@gmail.com>
To: ribalda@chromium.org
Cc: 98lawweijie@gmail.com, guennadi.liakhovetski@linux.intel.com,
hansg@kernel.org, laurent.pinchart@ideasonboard.com,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
mchehab@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] media: uvcvideo: Fix NULL deref on events for uninitialized controls
Date: Mon, 7 Sep 2026 16:12:22 +0800 [thread overview]
Message-ID: <20260907081222.2541314-1-98lawweijie@gmail.com> (raw)
In-Reply-To: <CANiDSCtypCfEoZbRvdT7EoJdd2G8yOVcvxBoS5LcE60UjFQx2g@mail.gmail.com>
On Mon, 7 Sept 2026 at 09:00:35, Ricardo Ribalda <ribalda@chromium.org> wrote:
>
> Could you provide more info on how you reproduced the error?
The device I used is a Facedancer UVC gadget in a QEMU VM running
v6.12.105 + KASAN. It has:
- a Video Control interface with an Extension Unit: id 3, one control
declared in bmControls, GUID not matching any known mapping,
- a status interrupt IN endpoint.
The crash is fully device-driven; from the host side the only
thing needed is a process that keeps the video device open -- any
camera application will do (no ioctl, and no privileges beyond normal
camera access: the opener can be any active desktop user).
Userspace never sends UVCIOC_CTRL_MAP / UVCIOC_CTRL_QUERY for that GUID,
so the XU control stays exactly as uvc_ctrl_init_chain() kzalloc'ed it
(XUs are initialized lazily by uvc_ctrl_init_ctrl(), which skips them).
Something then opens /dev/videoN, which arms the status URB, and the
device sends this 16-byte control change event:
bStatusType = 1 (control)
bOriginator = 3 (the XU)
bEvent = 0
bSelector = 0
bAttribute = 0 (VALUE_CHANGE)
bValue[11]
The worker dies before it can resubmit the status URB, so one open()
gives one oops and the endpoint goes quiet; closing and reopening the
node repeats it. The oops does not depend on KASAN -- it is a plain NULL
walk on any kernel.
> nit: I would not add the comment.
Sure! Will remove the comments in a V2 patch, which I will submit later
along with the [2/2] patch request since it's a duplicate of yours.
Regards,
Wei Jie
next prev parent reply other threads:[~2026-09-07 8:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 6:28 [PATCH 0/2] media: uvcvideo: Fix two bugs on the control change event path Wei Jie Law
2026-09-07 6:28 ` [PATCH 1/2] media: uvcvideo: Fix NULL deref on events for uninitialized controls Wei Jie Law
2026-09-07 7:00 ` Ricardo Ribalda
2026-09-07 8:12 ` Wei Jie LAW [this message]
2026-09-07 6:28 ` [PATCH 2/2] media: uvcvideo: Fix out-of-bounds read in uvc_ctrl_status_event() Wei Jie Law
2026-09-07 6:51 ` Ricardo Ribalda
2026-09-07 7:05 ` Wei Jie LAW
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260907081222.2541314-1-98lawweijie@gmail.com \
--to=98lawweijie@gmail.com \
--cc=guennadi.liakhovetski@linux.intel.com \
--cc=hansg@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=ribalda@chromium.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®