Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp22457pxb; Mon, 13 Sep 2021 11:53:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsJ06hI/3oFFpn+CsRJROjtoHhuG4j2OsVZev47NnUxPMJiD/xTQ7cwscpVKds1f4yYNb5 X-Received: by 2002:a5d:935a:: with SMTP id i26mr10155202ioo.79.1631559237583; Mon, 13 Sep 2021 11:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631559237; cv=none; d=google.com; s=arc-20160816; b=FAimF9mRnA5dRlo0yKSeBA92KKcQGXEGyde4vvbAZI+s10uWmLbbn1iCwNepKH574M eBVLAFoy6hLovrVoU2z4/QP3xKtEi1r1F9Iz0z45G/JOcKtvzGhBa0BLjI0wD6rNm+Ym eXzun/+/98IBHJQzkK+JZI0xFQc9o9vJJ3+llEnLlG/QYgRGnsNhAVraqO+P6Q0CdOJc weplRekb3kcJefIow5d+b4mOz2te+D9jUfrx5Vv0+AXmcssck1JBiOGQi4rc6gWi7ph7 /R9mDMxHeYRtwbGCfiPHOLBTGX4vKwoTJxCRB4MaR9qq+hF20LGiNBmp8SI1IkLlaENl wurA== 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=V4EhB4iJmnCN8GV+tJF+ExD+/xChtITHWe/3HgT3+ls=; b=zBqX9G0dq9bPmSmFoHmoHvNdzJo1AFsC8t5PELHZSfvHc50okhcfdmKGWr0OWnmwrU Pn2Dhvk+S2KqUrITMc3TXQLvTWqghv5yEYacb0OUVGnL4b3D5MW9ccZI0SYDFRG2doc8 5YQqjpJ/gcW7PUN4gH0EC7p2DHBMZrlVp54Psm8UsBCwlsryj1nkYqxFXR9fWb0U9NPE yhHQ1FyfSg0C09QN7u6+CrBwEefklzh47LFw0fL27gdA6CIhcyx/R3vo9r1Ujl0yNLkB wKSd9QWaK79mOTVL/OBuuCG7LM/N69hEfDh4Lb0hb+Kavq8LY/xxMBh5oeb5hZSG+GFv 6P+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=18tFQlFy; 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 f14si6993551ile.103.2021.09.13.11.53.45; Mon, 13 Sep 2021 11:53:57 -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=18tFQlFy; 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 S240978AbhIMN1L (ORCPT + 99 others); Mon, 13 Sep 2021 09:27:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:37988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240738AbhIMNYu (ORCPT ); Mon, 13 Sep 2021 09:24:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1F0DF61155; Mon, 13 Sep 2021 13:22:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539326; bh=R2+dmuWy9ps8BK3BYSZVBB2CONbUwAtvscysGBcHO1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=18tFQlFyWPR3npCDw/8tZCWmh02zxq/M/uXIgm1Z2cLICaUYCNPifvg33tcyCmiz3 V383VLzEm2TPlCIMazu0nyo5SfltZ3B9KNvJUNxBxyPVjcJJGV5aN7kLM2jOG7RBTL MxDO2qKe1uBBqH9n416ZhbWcYCQmIXUoKOUmOygM= 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.4 095/144] mac80211: Fix insufficient headroom issue for AMSDU Date: Mon, 13 Sep 2021 15:14:36 +0200 Message-Id: <20210913131051.121229174@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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 538722522ffe..4dfac7a25e5a 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3189,7 +3189,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