Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp68342pxb; Mon, 13 Sep 2021 13:09:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDNwCM1aEDtoHT3bjRg5tU66sjCsG+YDswXmX79eSsbTz5Bz68R3gtZvR7uOE71MBCWZDY X-Received: by 2002:a05:6402:2792:: with SMTP id b18mr14954230ede.173.1631563757916; Mon, 13 Sep 2021 13:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631563757; cv=none; d=google.com; s=arc-20160816; b=HGFJC8NcY86hvtVeh1/EeXikcIATuZr2nq6ntXgJqNM4HAdxJAiHgKiyksKCr1TKf3 hSgXOBijuZYPpkqj6JlRJlOCtw6Sel5mYP7CFLrONdckBeekxrwIqtJpFZWKnbI9sigB hgz/NoYZPf+FzFdJezuEREoI4sANuSYzzSky2nrBK+RNYAr5h8zUjioZDH2F7IXGV701 aF6ws5pL0TM+ZjSlH09/VGM57YI1HyKLA6jim4oJ5uB3fUqz2A+Hgw4kvNMvNVlI/gTn NYWs/un2sSoePVfWVq1rbJ0ySfewXSYRDNRVp/Rs8fCikDN6yfHndzXWJ1pIVBOvTpCV /uQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3NF+iet9WdKuHIo5tHBDmIiDvKZ0aQE/O7okFooRI5w=; b=xNCHff7k4Xfca0WaJktqk7DLyYZ07mCwV8RBQYAnv+awL0l0BBc1tTts7qjwp0QJuZ iqdOTx9Y0wKC/Y1qbOrXbPlaP0ishh6cE5p9ejVQr+9yEwWLgf+hRMfZPW4o2Rovl2ON siUqvonJrZYxkAvDSGKLLrhHpbeBnCbMN28Fg+VYprKdh3R4/bxIuPciHcm6VV4Rc05z qOfLNdWSrBCG8rX4GSfD68Zl8DyNtcsxkG8XtoLaFZEJ7ywIknsELmtxhUGsTmKeBrqM zSPrQJVfw928psUBR30kNOQLt/frYsP6BejH979txze+/GaePqcjiGlShSXRpCgaifCF LnOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z46tD3lq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si3440340edo.210.2021.09.13.13.08.53; Mon, 13 Sep 2021 13:09:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z46tD3lq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243228AbhIMNrL (ORCPT + 99 others); Mon, 13 Sep 2021 09:47:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:46598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243161AbhIMNmD (ORCPT ); Mon, 13 Sep 2021 09:42:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 47C9F61356; Mon, 13 Sep 2021 13:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539794; bh=STBeG+o71Ug78FNlxlQGz9BreD5lnwxXa0QtuceS2l4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z46tD3lqG9v1/g+OU8OY/pfIuElanXaHBMARwGd9++qNFdXhQs1YmyPn7dl9l7FyC zkkFMtm684Z7N0bc7VXzUifPi3vcYYml9bA4Ov2tBSrKaPjQ9os6erh8zptEm/sTDX vLjF693/drkkz6c/EF+k1+HQkD5CdbAr7VKmZjf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chih-Kang Chang , Ping-Ke Shih , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 162/236] mac80211: Fix insufficient headroom issue for AMSDU Date: Mon, 13 Sep 2021 15:14:27 +0200 Message-Id: <20210913131105.894213559@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chih-Kang Chang [ Upstream commit f50d2ff8f016b79a2ff4acd5943a1eda40c545d4 ] ieee80211_amsdu_realloc_pad() fails to account for extra_tx_headroom, the original reserved headroom might be eaten. Add the necessary extra_tx_headroom. Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Link: https://lore.kernel.org/r/20210816085128.10931-2-pkshih@realtek.com [fix indentation] Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/tx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 20b3581a1c43..673ad3cf2c3a 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3229,7 +3229,9 @@ static bool ieee80211_amsdu_prepare_head(struct ieee80211_sub_if_data *sdata, if (info->control.flags & IEEE80211_TX_CTRL_AMSDU) return true; - if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(*amsdu_hdr))) + if (!ieee80211_amsdu_realloc_pad(local, skb, + sizeof(*amsdu_hdr) + + local->hw.extra_tx_headroom)) return false; data = skb_push(skb, sizeof(*amsdu_hdr)); -- 2.30.2