From: Sasha Levin Date: Fri, 28 Jun 2019 19:43:25 +0000 (-0400) Subject: fixes for 4.14 X-Git-Tag: v5.1.16~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a2db7fe466073eed7184c7cae46f2f97cdffce91;p=thirdparty%2Fkernel%2Fstable-queue.git fixes for 4.14 Signed-off-by: Sasha Levin --- diff --git a/queue-4.14/qmi_wwan-fix-out-of-bounds-read.patch b/queue-4.14/qmi_wwan-fix-out-of-bounds-read.patch new file mode 100644 index 00000000000..c2ea4754ca8 --- /dev/null +++ b/queue-4.14/qmi_wwan-fix-out-of-bounds-read.patch @@ -0,0 +1,68 @@ +From cf9bdf1d29932c6f39d1986ef758918231d82eb1 Mon Sep 17 00:00:00 2001 +From: Kristian Evensen +Date: Thu, 27 Jun 2019 12:01:05 +0200 +Subject: qmi_wwan: Fix out-of-bounds read +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 904d88d743b0c94092c5117955eab695df8109e8 upstream. + +The syzbot reported + + Call Trace: + __dump_stack lib/dump_stack.c:77 [inline] + dump_stack+0xca/0x13e lib/dump_stack.c:113 + print_address_description+0x67/0x231 mm/kasan/report.c:188 + __kasan_report.cold+0x1a/0x32 mm/kasan/report.c:317 + kasan_report+0xe/0x20 mm/kasan/common.c:614 + qmi_wwan_probe+0x342/0x360 drivers/net/usb/qmi_wwan.c:1417 + usb_probe_interface+0x305/0x7a0 drivers/usb/core/driver.c:361 + really_probe+0x281/0x660 drivers/base/dd.c:509 + driver_probe_device+0x104/0x210 drivers/base/dd.c:670 + __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:777 + bus_for_each_drv+0x15c/0x1e0 drivers/base/bus.c:454 + +Caused by too many confusing indirections and casts. +id->driver_info is a pointer stored in a long. We want the +pointer here, not the address of it. + +Thanks-to: Hillf Danton +Reported-by: syzbot+b68605d7fadd21510de1@syzkaller.appspotmail.com +Cc: Kristian Evensen +Fixes: e4bf63482c30 ("qmi_wwan: Add quirk for Quectel dynamic config") +Signed-off-by: Bjørn Mork + +[Upstream commit did not apply because I shuffled two lines in the +backport. The fixes tag for 4.14 is 3a6a5107ceb3.] + +Signed-off-by: Kristian Evensen +Signed-off-by: Sasha Levin +--- + drivers/net/usb/qmi_wwan.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index c2d6c501dd85..063daa3435e4 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -1395,14 +1395,14 @@ static int qmi_wwan_probe(struct usb_interface *intf, + return -ENODEV; + } + +- info = (void *)&id->driver_info; +- + /* Several Quectel modems supports dynamic interface configuration, so + * we need to match on class/subclass/protocol. These values are + * identical for the diagnostic- and QMI-interface, but bNumEndpoints is + * different. Ignore the current interface if the number of endpoints + * equals the number for the diag interface (two). + */ ++ info = (void *)id->driver_info; ++ + if (info->data & QMI_WWAN_QUIRK_QUECTEL_DYNCFG) { + if (desc->bNumEndpoints == 2) + return -ENODEV; +-- +2.20.1 + diff --git a/queue-4.14/series b/queue-4.14/series index 4f2078f58a9..8795a73e993 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -11,3 +11,4 @@ block-bio_iov_iter_get_pages-pin-more-pages-for-mult.patch 9p-rdma-remove-useless-check-in-cm_event_handler.patch 9p-p9dirent_read-check-network-provided-name-length.patch net-9p-include-trans_common.h-to-fix-missing-prototy.patch +qmi_wwan-fix-out-of-bounds-read.patch