提交 12943f09 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

USB: less-restrictive command checking in g-file-storage

This patch (as983) makes a test for minimum-length command sizes in
g_file_storage less restrictive.  It doesn't matter because commands
with bad lengths will be detected later on anyway, and doing it like
this makes the driver interoperable with certain buggy hosts such as
the JVC HiFi (reported by Samuel Hangouet).
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 94d0f7ea
...@@ -2964,7 +2964,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) ...@@ -2964,7 +2964,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
/* Is the CBW meaningful? */ /* Is the CBW meaningful? */
if (cbw->Lun >= MAX_LUNS || cbw->Flags & ~USB_BULK_IN_FLAG || if (cbw->Lun >= MAX_LUNS || cbw->Flags & ~USB_BULK_IN_FLAG ||
cbw->Length < 6 || cbw->Length > MAX_COMMAND_SIZE) { cbw->Length <= 0 || cbw->Length > MAX_COMMAND_SIZE) {
DBG(fsg, "non-meaningful CBW: lun = %u, flags = 0x%x, " DBG(fsg, "non-meaningful CBW: lun = %u, flags = 0x%x, "
"cmdlen %u\n", "cmdlen %u\n",
cbw->Lun, cbw->Flags, cbw->Length); cbw->Lun, cbw->Flags, cbw->Length);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册