Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3057785ybi; Tue, 2 Jul 2019 01:18:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3fOG+c+l4I/IUNkTJPTcUaj2R34YKniqH2h+ZfYlIRR93ao01YVzBLr/EXpbQPsiyX9aN X-Received: by 2002:a63:6981:: with SMTP id e123mr28920224pgc.136.1562055508410; Tue, 02 Jul 2019 01:18:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562055508; cv=none; d=google.com; s=arc-20160816; b=mrXUz8JZGYH96W+B59gSSuPNyo9ulLwQjWBkHdaVUAi8gnkt+lKlK/Rfy6AD3g/x9o s3BLt7iiyU1J6QpaGWY7UV3TU8JQnxIY5YvC/OGgtioiSII/VYkp4JCPwaqTl9L5nVA+ GjuFZ0qa4YrreJIJORkd201m/tdpAPowCmiNOod0aiach16TTq2lblD69lKiPiRsVjqT wTVI9sciXRdONCrMjlcB1i9XZFe7vw0iTB6V13Yjy+YENWzO4a4FL2AjQtgJBP5yHHVZ lQRtPgfa8yq+FHsrJv0993SnSqmdlnL/6QqfpqcP9LAtMsp1sYdxONNpP/wMARp6eEcn +VRw== 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=U8KdWeEtqHqMhzn5ysMfvdoCxpvg9cYy4epfYmr+Gyq4n0+mfXzcsiBL6fH/5btoT9 PccIv6t1nD5BCyJu2qElaR/aQSMvRBzT9kailu2nxVzqZfIotUf5ENnOd9X4UHdzMATe zBZuS1Rs50lFJmixX9DRSlj+Q6/Ze0PL4wac1Z94Ht7lM8+1wfUtRbYAu1WGWonAcU2w rT4VzrydW3Ois2KpLMntJuqQ942VLkT+7GZsDgMz/ekWjaqY2qYICQAdnoaO9ThppCUa ownbUzV86hkB7D+GkVhzhOcMyNEG456/7bAIo5jmWxbnSNtxohuNelxYJUBcLBrpc/tq cMdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ykwC6kPy; 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 z13si14546783pfr.86.2019.07.02.01.18.13; Tue, 02 Jul 2019 01:18:28 -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=ykwC6kPy; 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 S1727472AbfGBIQo (ORCPT + 99 others); Tue, 2 Jul 2019 04:16:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:48644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727125AbfGBIDf (ORCPT ); Tue, 2 Jul 2019 04:03:35 -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 450012184C; Tue, 2 Jul 2019 08:03:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562054614; bh=F0z/Qt1OUgKcq+NpAv5Pu2gellH7RLZ46sZaWd1mOUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ykwC6kPyTSi43oQ06XUupOH/7b7A0fYmCq/ipJoUpcjuXqurDoRC+zj1DOlwMUZdX A/fUl8dyps6tBh5Z/zVydSuJlvGxD/TLo0iI83TaK99dqGNCabpnyoTBODyyy7tzRF slj/E1uGXTbB5BvGNgLy6Iv7ukV5490FlfpZiOq8= 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 5.1 03/55] qmi_wwan: Fix out-of-bounds read Date: Tue, 2 Jul 2019 10:01:11 +0200 Message-Id: <20190702080124.249874731@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190702080124.103022729@linuxfoundation.org> References: <20190702080124.103022729@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