Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3050475ybi; Tue, 2 Jul 2019 01:09:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJ0NQI+fdyhQQ1Kc5pyjsligeCJhvJ7YGHdMvZdlEOruJuq5y05D4Mn1/aIHv/eNhoeENh X-Received: by 2002:a17:90a:ac14:: with SMTP id o20mr4171087pjq.114.1562054958537; Tue, 02 Jul 2019 01:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562054958; cv=none; d=google.com; s=arc-20160816; b=mhhPT6QrbceEiOlvC/HtfuXJmALca5tuPaBdpxQejUsnBpscvBtRAhLtSRxcTNURFX wwV1GA9L7dE9Iio7ni38NhbYLvTBKX5HAPUJtTq1qiVcOa5w0MvVw0IAS/daE3dm5fwU Zf0G+W2pz0VSmOTdHF9naUb2PkpZRsx/Z/JRZoBQkcieoIJFO0ZMbEkRdIlYAbCbvyu1 iQTirHQd0hV2D49Uud80+FRKxtmPMDcsun785o7XYLcL8feCrXqvflMYyasQIVY1rq27 9XeAKuPWL2z1brF+EE2RWbUcBCcDfnkzkMYQKWLGOYjvzDvi18eoM9C1+2+FJy1K4tCe z7jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=K4RAEUbvcThjd6+cUNk8/NrQPnfFc/WcmN+UY5pXy0M=; b=x/3MiEg9hxn4+mtXsNk8cQ8Ug5DulkU5Wpk+sV0QE2IARfFEKO7Q3xNSW1MVk62/qL HN4I1lZOv9P7frbzuPqqvpB3vvroAhYPUyJQVVzq7YnNbr6KurEalhSD+3ngzzPYZsfO sTkV4A1fPYwrGyceYeQU2quwWLGejB7qXqut/basjMcfcQY0jbYm5PE+3QnYH+fhoys9 djZvlAXO0ZNns/13T7/Iijmik6X8ye8FmjfrieHFE5W0x5OSEkRF3caplIEJlCxwsNfX SWfC3O5gwmBLd6PElt6Z+VEWbwSlWnBMMujc+TmJsiYc7r5fbzOrMi+oECZPVxZz1Cnp WKiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QLtJAUVL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 123si9030374pgb.374.2019.07.02.01.09.03; Tue, 02 Jul 2019 01:09:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QLtJAUVL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727811AbfGBIHt (ORCPT + 99 others); Tue, 2 Jul 2019 04:07:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:55138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727976AbfGBIHp (ORCPT ); Tue, 2 Jul 2019 04:07:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 960022183F; Tue, 2 Jul 2019 08:07:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562054865; bh=F0z/Qt1OUgKcq+NpAv5Pu2gellH7RLZ46sZaWd1mOUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QLtJAUVLGFh5g4FcvRAx60T09AI6AY/qjMVxem2RZIVpLsWoJsqgR9pV3jxRwlyjd OO+dn+zgY2XOHPhFSXN3U6n61DeE1aEUZ9bHLcJYLf/hnXSQIbZEBi5fZWtqGpPpyn u4kLIcNCjJktixrCQ0UIbdjMGPvL0ByFxUaGk7Fk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+b68605d7fadd21510de1@syzkaller.appspotmail.com, Kristian Evensen , =?UTF-8?q?Bj=C3=B8rn=20Mork?= , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 22/72] qmi_wwan: Fix out-of-bounds read Date: Tue, 2 Jul 2019 10:01:23 +0200 Message-Id: <20190702080125.824008218@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190702080124.564652899@linuxfoundation.org> References: <20190702080124.564652899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 904d88d743b0c94092c5117955eab695df8109e8 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/qmi_wwan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index d9a6699abe59..e657d8947125 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -1412,7 +1412,7 @@ static int qmi_wwan_probe(struct usb_interface *intf, * different. Ignore the current interface if the number of endpoints * equals the number for the diag interface (two). */ - info = (void *)&id->driver_info; + info = (void *)id->driver_info; if (info->data & QMI_WWAN_QUIRK_QUECTEL_DYNCFG) { if (desc->bNumEndpoints == 2) -- 2.20.1