Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3289000ybb; Tue, 31 Mar 2020 02:10:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu1BuRBcauOK1HyDnj/z32AdAgpNKHAv8xPQ6vEvbHIKJeE5u1nA/bxtlEoRnuJ/tsBOrsT X-Received: by 2002:a9d:2c69:: with SMTP id f96mr2329561otb.62.1585645854857; Tue, 31 Mar 2020 02:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645854; cv=none; d=google.com; s=arc-20160816; b=cWroPE9ptjSsfRLePGontLHe0XP2HekxTAFDUa7LAMiFE6FcJJHAZh2dtc5dhHNbTn nHnuyV42pdrEsgj/WdTownFJw2Bkx0kmT4jkHNwUJdTndE3B5epb+CIPGNAxbj6oYOsT Fg5ma0A2L743jtJ55BtzMufgx0IEGSZiIgnaDWX/CrOKVfWsEpEM9KjM0WcwKAe0dwXQ S0DdpChtnxFRr0YW+oziMCcVNxaOo9YI7GZ/WV5gWmJrU013aCr4G2ywWRoDtM1BeFIs 2Fpnjjtyce+2vf81KEi9zVVb3OghE9NhkxmnY+wPXhs5+Npdb9DORC3mZ9G/uObpLJn2 ib3w== 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=tIrTFqiL+9D/kPGWcT/rOJahGms9z2U0lynmRoVcc7bFJsySUjbJmWSw5wYVt4qb+f LVVT3b0w4jis4vD96TRD1yRRh5FtCKxiYHsMtwvxtYIZ3WsQEpc7eS8eQKldu2Hxtmpo NYF+OtwcgcX5fDSWqThPp6A1bPxGguJ6x8nMYrivEHLU9zoypjnfu+/r9uRRdF7FshIZ jdtJjY4bGQhOp/z/Uno90PiSZcvZxsbcl9lcFdeqU03sZZxNoqQpAlzFvcaCTuHPlOq6 0bQUX/bVx5k+kRI0toNHvk98gnS3Y9+zQ89FpBhQJg1El5x7MDYy9MzB7C9/YeMeXgvd CgiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="xB/tvSXc"; 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 v130si7075620oib.115.2020.03.31.02.10.42; Tue, 31 Mar 2020 02:10:54 -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="xB/tvSXc"; 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 S1731589AbgCaJKX (ORCPT + 99 others); Tue, 31 Mar 2020 05:10:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:54136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731584AbgCaJKV (ORCPT ); Tue, 31 Mar 2020 05:10:21 -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 1835D20772; Tue, 31 Mar 2020 09:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645821; bh=ho35sVTquqF+nMCh8sjY2bccs/JY5rCm7rSUWaXHH/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xB/tvSXcmwEGjC4xmu771qDWt+s8H1xY6W7Xps9USG0a6C1ZnXNBcS1Z0MSGNJLQQ oiG/JhpyN3Ix2T8iwMY3mZZ3sVq04r8LzGN0sa2fmlfwiNxsFuYa6z4m4Ih15SP7eB hF7lWrcZBj/byeHir5uphPbGhGn2te36c4G5XpAs= 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.5 160/170] staging: wlan-ng: fix use-after-free Read in hfa384x_usbin_callback Date: Tue, 31 Mar 2020 10:59:34 +0200 Message-Id: <20200331085439.854944686@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@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);