Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3926590imm; Mon, 8 Oct 2018 11:48:45 -0700 (PDT) X-Google-Smtp-Source: ACcGV61Z/Lj4h3xMJmlTQ3hhyDhFsc1+tT+NFb2UgLyrUxqpN09TD65DhOXtzb+5aLtWdo3HLjd6 X-Received: by 2002:a63:a42:: with SMTP id z2-v6mr21916452pgk.209.1539024525595; Mon, 08 Oct 2018 11:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024525; cv=none; d=google.com; s=arc-20160816; b=Yzdh4U0fxuMkbiN8bbDLg9htbCbM4lN7O6LjNBM/JZmyT3HKEx+rx+W36E6yiE0fhO RAKqLVTGJ2prIOEcsVzoSnjiSTCC7KbNlFQfElY4befSEoIb63gGFouCveHHSK5lZkEN 9Plum1bMDp0CFAAn8QDPrGyBdrVbfmU2jxlFYLdEShFjto/58WCGNeH4KDt3ExaS8zw2 TlysMuv+H1SNHomt0MvRocoV+mLBoYefsLJqjMY3Pgdny3320t2Xw+d3BlO/qwmAiV35 eLU98/8NET9A1V/8LL9RJ9FaHl3wrZD/p2bQgeCs6AkX5DULaN4mJ5vNHQxizE0aWADj /GEw== 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=CnqROcaLCw4haCv3iE8qVnuAZDel3KueMhSKWjoEDpE=; b=Lh/9fP23/PDOyP0wv1bfDruvncxZbHm93gxFW7mpAxlweiXtOPT7A5L9fRVH0fuscI oPfLrBSqkMYxz+xv/GQjYmgsVI8rPpoErJsrJjLPPQSjTC7VkI+L/r3FqxCMMKuHe6hP 6QjKjFLf4eVOhpKXvxQMHz5+VODnc3AmznQHTEyfbRH+umQqPmLMyD6HcglgFhqfw7XQ NONn9dIa9OKPz2bUZK5hgX9lSLvKwD1LytZzczQYJmZbE3bYlDA5Gj7UqiDm4xOGG7IB gf8DMZThXxVLeK9VyYyqNbCYNkG34XzqDsn1r2/04DQ3ibLr1tnEZQPRxLztzKgr3E1S Me0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jP8cl0NH; 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 k10-v6si17198201plt.328.2018.10.08.11.48.30; Mon, 08 Oct 2018 11:48:45 -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=jP8cl0NH; 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 S1731663AbeJICBc (ORCPT + 99 others); Mon, 8 Oct 2018 22:01:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:50550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727452AbeJICBa (ORCPT ); Mon, 8 Oct 2018 22:01:30 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (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 5EE02204FD; Mon, 8 Oct 2018 18:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024503; bh=evhVFQvZagh/tsN4XPCb8IvWMtJUX0Z2bat5itb22c0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jP8cl0NHhYV1+2mShcXHThuWzkct/a83nn/2Xcajsu1byskM567hNw39Kom0+dyGw qomoMvP8paHw0pcEaM7pngxtaVMACnoUshHQZ8UasIF8e23DrxlCWzwXdKwZR7POWQ Dp8mPpRNR+tfzttwuL2fNGDyjQ+L7XdjHJdkG1xs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Lorenzo Bianconi , Sasha Levin Subject: [PATCH 4.18 039/168] mac80211: always account for A-MSDU header changes Date: Mon, 8 Oct 2018 20:30:19 +0200 Message-Id: <20181008175621.533844858@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johannes Berg [ Upstream commit aa58acf325b4aadeecae2bfc90658273b47dbace ] In the error path of changing the SKB headroom of the second A-MSDU subframe, we would not account for the already-changed length of the first frame that just got converted to be in A-MSDU format and thus is a bit longer now. Fix this by doing the necessary accounting. It would be possible to reorder the operations, but that would make the code more complex (to calculate the necessary pad), and the headroom expansion should not fail frequently enough to make that worthwhile. Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") Signed-off-by: Johannes Berg Acked-by: Lorenzo Bianconi Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/mac80211/tx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3239,7 +3239,7 @@ static bool ieee80211_amsdu_aggregate(st if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(rfc1042_header) + 2 + pad)) - goto out; + goto out_recalc; ret = true; data = skb_push(skb, ETH_ALEN + 2); @@ -3256,11 +3256,13 @@ static bool ieee80211_amsdu_aggregate(st head->data_len += skb->len; *frag_tail = skb; - flow->backlog += head->len - orig_len; - tin->backlog_bytes += head->len - orig_len; - - fq_recalc_backlog(fq, tin, flow); +out_recalc: + if (head->len != orig_len) { + flow->backlog += head->len - orig_len; + tin->backlog_bytes += head->len - orig_len; + fq_recalc_backlog(fq, tin, flow); + } out: spin_unlock_bh(&fq->lock);