Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3282581ybb; Tue, 31 Mar 2020 02:02:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvNFTSbuo+8dxBgC49DRcKVpcTTacsI/9dPD1WX2vwOIlmbg2QdIpfiUCzA1DgGPt8zn0xa X-Received: by 2002:a05:6830:3109:: with SMTP id b9mr12863892ots.369.1585645369494; Tue, 31 Mar 2020 02:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645369; cv=none; d=google.com; s=arc-20160816; b=Nz1ckQ0wW8fSIamyVMaZHti0uTjY9haBYeARl1FKKB4DJje4OMKPhV6++CRWGaVUDo dojMM38kWShfWRFvP204BjUmFSPGPex9G99sRnygRdNsah1v75t2Wj+9p1GWiOGpXexO 6M/ldghhYRTwJ74+sbnUYAWQWj2LoSoMWWymmIPkNbvso30z4aFFhOCxEPWbe2krqhk3 Xky9DXtL2wh6ZmO6MCHUKncNYWa/nCvsesHcTQMPNCWhNjBTTioPxa2pK1Ikm7lip90y jHnFOl2JaQ0TUi85ojhEjE6iqDoafvP/X1XUoh04cuM7qLgH8d7W+IPFiRAu5YlN7tPQ YCBA== 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=0zkz+2cV6gaiOvmQ2+a7QhQIqf1yxsVWXuEW48RJWpE=; b=vjnuXGLLeiYSJ3TsYonpdME81yG/ifenXEnqYGRRjWaADigTkgWFcm99fB3DOQxncs bOAwVCciXj3NTnRvFVVTYDapyACW7jB8hkcTgdzBNIY51zrPlU42GadOH3NIfBOZyGb1 1Oc5TBASW71CjibUOotc6wORjjyN0IBiSNN0YHgLJG9SWBXykYT/BcJuT1u/6tZyoCcz J2Uzn108i07T2Y92qUOO4kVPXSwNK4/PmdX/zMo0L4lMUWI07L8KPqN8F8q4ueEZya1J 5Cb+6m9TOxTQyYvaWLJyCP66SIzz7h6Dohrq+TCVJVTU3vLM1crwFHKLl1R2UPnawYOd cOTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GKun6qYp; 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 t2si6624575oih.136.2020.03.31.02.02.37; Tue, 31 Mar 2020 02:02:49 -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=GKun6qYp; 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 S1730470AbgCaJAy (ORCPT + 99 others); Tue, 31 Mar 2020 05:00:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:39870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730285AbgCaJAw (ORCPT ); Tue, 31 Mar 2020 05:00:52 -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 11BF820B1F; Tue, 31 Mar 2020 09:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645252; bh=ho35sVTquqF+nMCh8sjY2bccs/JY5rCm7rSUWaXHH/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GKun6qYpPzAbtYm3X9Xcdz/ORnTYin8I40yoHlLSwVbI6XwMethJw50eCplNlS5HO CcC/m/Qa3yeLHfSIfFmXWkF51E83+uw5fh54AvfWURlGxlHjpXLZe4vZPA5/1JlWmp zNt5pN8uuulsYkc3YgQnqsflcjRbJatKAPAJgLAs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiujun Huang , syzbot+7d42d68643a35f71ac8a@syzkaller.appspotmail.com Subject: [PATCH 5.6 13/23] staging: wlan-ng: fix use-after-free Read in hfa384x_usbin_callback Date: Tue, 31 Mar 2020 10:59:25 +0200 Message-Id: <20200331085314.292545907@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085308.098696461@linuxfoundation.org> References: <20200331085308.098696461@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 From: Qiujun Huang commit 1165dd73e811a07d947aee218510571f516081f6 upstream. We can't handle the case length > WLAN_DATA_MAXLEN. Because the size of rxfrm->data is WLAN_DATA_MAXLEN(2312), and we can't read more than that. Thanks-to: Hillf Danton Reported-and-tested-by: syzbot+7d42d68643a35f71ac8a@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang Cc: stable Link: https://lore.kernel.org/r/20200326131850.17711-1-hqjagain@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x_usb.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -3372,6 +3372,8 @@ static void hfa384x_int_rxmonitor(struct WLAN_HDR_A4_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN)) { pr_debug("overlen frm: len=%zd\n", skblen - sizeof(struct p80211_caphdr)); + + return; } skb = dev_alloc_skb(skblen);