Forwarded: [PATCH 1/1] media: dvb-usb-v2: ce6230: fix bug when sending usb_control_msg of size 0

syzbot posted 1 patch 1 month, 3 weeks ago
drivers/media/usb/dvb-usb-v2/ce6230.c | 7 +++++++
1 file changed, 7 insertions(+)
Forwarded: [PATCH 1/1] media: dvb-usb-v2: ce6230: fix bug when sending usb_control_msg of size 0
Posted by syzbot 1 month, 3 weeks ago
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH 1/1] media: dvb-usb-v2: ce6230: fix bug when sending usb_control_msg of size 0
Author: jakovnovak30@gmail.com

#syz test

---
 drivers/media/usb/dvb-usb-v2/ce6230.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/media/usb/dvb-usb-v2/ce6230.c b/drivers/media/usb/dvb-usb-v2/ce6230.c
index 7ebaf3ee4491..dd3aa45b56a3 100644
--- a/drivers/media/usb/dvb-usb-v2/ce6230.c
+++ b/drivers/media/usb/dvb-usb-v2/ce6230.c
@@ -23,6 +23,13 @@ static int ce6230_ctrl_msg(struct dvb_usb_device *d, struct usb_req *req)
 	value = req->value;
 	index = req->index;
 
+	if (!req->data_len) {
+		dev_err(&d->udev->dev,
+				"%s: cannot send crtl_msg of size 0",
+				KBUILD_MODNAME);
+		return -ENOBUFS;
+	}
+
 	switch (req->cmd) {
 	case I2C_READ:
 	case DEMOD_READ:
-- 
2.53.0