From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Dan Carpenter <dan.carpenter@oracle.com>,
"David S. Miller" <davem@davemloft.net>,
Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Subject: [PATCH 5.3 1/6] net: cdc_ncm: Signedness bug in cdc_ncm_set_dgram_size()
Date: Fri, 22 Nov 2019 11:30:03 +0100 [thread overview]
Message-ID: <20191122100322.128248608@linuxfoundation.org> (raw)
In-Reply-To: <20191122100320.878809004@linuxfoundation.org>
From: Dan Carpenter <dan.carpenter@oracle.com>
commit a56dcc6b455830776899ce3686735f1172e12243 upstream.
This code is supposed to test for negative error codes and partial
reads, but because sizeof() is size_t (unsigned) type then negative
error codes are type promoted to high positive values and the condition
doesn't work as expected.
Fixes: 332f989a3b00 ("CDC-NCM: handle incomplete transfer of MTU")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/usb/cdc_ncm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -579,7 +579,7 @@ static void cdc_ncm_set_dgram_size(struc
err = usbnet_read_cmd(dev, USB_CDC_GET_MAX_DATAGRAM_SIZE,
USB_TYPE_CLASS | USB_DIR_IN | USB_RECIP_INTERFACE,
0, iface_no, &max_datagram_size, sizeof(max_datagram_size));
- if (err < sizeof(max_datagram_size)) {
+ if (err != sizeof(max_datagram_size)) {
dev_dbg(&dev->intf->dev, "GET_MAX_DATAGRAM_SIZE failed\n");
goto out;
}
next prev parent reply other threads:[~2019-11-22 11:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 10:30 [PATCH 5.3 0/6] 5.3.13-stable review Greg Kroah-Hartman
2019-11-22 10:30 ` Greg Kroah-Hartman [this message]
2019-11-22 10:30 ` [PATCH 5.3 2/6] block, bfq: deschedule empty bfq_queues not referred by any process Greg Kroah-Hartman
2019-11-22 10:30 ` [PATCH 5.3 4/6] mm/memory_hotplug: fix updating the node span Greg Kroah-Hartman
2019-11-22 10:30 ` [PATCH 5.3 5/6] arm64: uaccess: Ensure PAN is re-enabled after unhandled uaccess fault Greg Kroah-Hartman
2019-11-22 10:30 ` [PATCH 5.3 6/6] fbdev: Ditch fb_edid_add_monspecs Greg Kroah-Hartman
2019-11-22 13:39 ` [PATCH 5.3 0/6] 5.3.13-stable review Jon Hunter
2019-11-22 13:39 ` Jon Hunter
2019-11-22 13:46 ` Greg Kroah-Hartman
2019-11-22 18:14 ` Guenter Roeck
2019-11-24 7:00 ` Greg Kroah-Hartman
2019-11-22 20:45 ` shuah
2019-11-23 17:36 ` Greg Kroah-Hartman
2019-11-22 23:50 ` Daniel Díaz
2019-11-23 17:29 ` Greg Kroah-Hartman
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=20191122100322.128248608@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=nobuhiro1.iwamatsu@toshiba.co.jp \
--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 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.