From: Andi Shyti <andi.shyti@kernel.org>
To: linux-media@vger.kernel.org, linux-usb@vger.kernel.org,
syzkaller-bugs@googlegroups.com, stable@vger.kernel.org
Cc: Alan Stern <stern@rowland.harvard.edu>,
Antti Palosaari <crope@iki.fi>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Andi Shyti <andi.shyti@kernel.org>
Subject: [PATCH] media: dvb-usb-v2: ec168: Reject zero-length I2C reads
Date: Mon, 19 Oct 2026 14:35:42 +0200 [thread overview]
Message-ID: <20261019123542.4040472-1-andi.shyti@kernel.org> (raw)
ec168_i2c_xfer() checks the length of the register-address
message in a combined demodulator read, but does not validate the
read message length. Userspace can supply a zero-length read
through I2C_RDWR.
This reaches ec168_ctrl_msg(), which selects an IN control pipe
for READ_DEMOD with wLength set to zero. The USB core treats
control requests without a data stage as OUT(*), triggering the
"BOGUS control dir" warning in usb_submit_urb().
Reject zero-length read messages with -EOPNOTSUPP before issuing
the USB request, using the existing exit path to release the I2C
mutex.
(*) is_out = ... || !setup->wLength;
Fixes: 2bf290be4f3e ("V4L/DVB (13364): ec168: add new driver for E3C EC168 DVB USB")
Reported-by: syzbot+ed3ada41c4eb1c4ab78e@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ed3ada41c4eb1c4ab78e
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Cc: <stable@vger.kernel.org> # v2.6.33+
---
drivers/media/usb/dvb-usb-v2/ec168.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb-v2/ec168.c b/drivers/media/usb/dvb-usb-v2/ec168.c
index 973b32356b17..f6b98c7d3704 100644
--- a/drivers/media/usb/dvb-usb-v2/ec168.c
+++ b/drivers/media/usb/dvb-usb-v2/ec168.c
@@ -115,7 +115,7 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
while (i < num) {
if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) {
if (msg[i].addr == ec168_ec100_config.demod_address) {
- if (msg[i].len < 1) {
+ if (msg[i].len < 1 || msg[i+1].len < 1) {
i = -EOPNOTSUPP;
break;
}
--
2.55.0
next reply other threads:[~2026-10-19 12:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 12:35 Andi Shyti [this message]
2026-10-19 12:45 ` [PATCH] media: dvb-usb-v2: ec168: Reject zero-length I2C reads sashiko-bot
2026-10-19 14:13 ` Alan Stern
-- strict thread matches above, loose matches on Subject: below --
2026-10-23 2:55 [PATCH] media: dvb-usb-v2: ec168: reject " Zhao Feng
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=20261019123542.4040472-1-andi.shyti@kernel.org \
--to=andi.shyti@kernel.org \
--cc=crope@iki.fi \
--cc=gregkh@linuxfoundation.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=stable@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=syzkaller-bugs@googlegroups.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.