Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp141508pxb; Mon, 16 Aug 2021 01:53:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZEioOBQXaId/z29pZvP94LBIv2M7O8syS8br8pE+y8E6jIi49Yc3uPZJPAgSv7/gsdG0P X-Received: by 2002:a92:ce03:: with SMTP id b3mr11184181ilo.267.1629103999880; Mon, 16 Aug 2021 01:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629103999; cv=none; d=google.com; s=arc-20160816; b=ttSiCP87iOvwUBSz9aDbCHsIKjcAYaZcD9eXORNAWQnKbiuWiWiP9Oagyl6NY3rGJ1 rEQazDuYIv340oe0xLoOEvkg6bwq6SkRKGr8boKkl6StXYXSFbms631QVa0ZLJLXxWi/ 0UNBz9i3Ljjfmiqq/uZQXRqlUrlMnJN9lgerLChzE/BnRiuXQV8qFME8Hsy/WZRNKuG7 LlL45kaH8JO4l5m0FjsnFCfFqp0cPdjwvkZA7HxGnf0XLZ2H3u9HKPJZWRynaHbJEBYF LNdFI8zA8qyws03xEx4oibn78TSfHgU82GJ9sYGY1ZqJZQ8cVaCkeFuS0aHlgqUnY7MZ bfBg== 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 :message-id:date:subject:cc:to:from:authenticated-by; bh=KsSEBp0n2EwwwRzsp746MxAnvrMkarBvtZpXV279gB4=; b=bFN3QJ/INZraENpi6CLJ2s1sW1oYgKYw0cgpEG5XdGGB3W+4Ls2ppn6pDDAWpAv465 kM4o6pmMnr+vYCeG28GIZwOaMhJmZuIq94lZyb/nlTH/HyWDikb/6EzbTKnkY8xPdAAu Jf2KenF04wW2fN/+MyNeD4Q15ZN32NoKi5noDOVhED39StwLtFntyAL2aDSMI6xwu9xD va/ayzlO/wb6LA+basQMyrU/9BRcLi0I9/nrbOGyu4mtuLTj8lNl7xjunTAdrsqkFeg1 htmlDOy227YmIpBv46+ipaq6voy3jBRX2T8JJx574Qm7XxSpCZjonHXEoZGcdFCFtjeN hidg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si10222744ior.73.2021.08.16.01.53.04; Mon, 16 Aug 2021 01:53:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234962AbhHPIw5 (ORCPT + 99 others); Mon, 16 Aug 2021 04:52:57 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:37343 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234861AbhHPIw4 (ORCPT ); Mon, 16 Aug 2021 04:52:56 -0400 Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.73 with qID 17G8qHQh9026669, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36502.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.71/5.88) with ESMTPS id 17G8qHQh9026669 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 16 Aug 2021 16:52:17 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36502.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 16 Aug 2021 16:52:17 +0800 Received: from localhost (172.21.69.146) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 16 Aug 2021 16:52:07 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 1/2] mac80211: Fix ieee80211_amsdu_aggregate frag_tail bug Date: Mon, 16 Aug 2021 16:51:27 +0800 Message-ID: <20210816085128.10931-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.146] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: trusted connection X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Deterministic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 08/16/2021 06:52:00 X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: =?big5?B?Q2xlYW4sIGJhc2VzOiAyMDIxLzgvMTYgpFekyCAwMzowNjowMA==?= X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-KSE-ServerInfo: RTEXH36502.realtek.com.tw, 9 X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-KSE-AntiSpam-Outbound-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 08/16/2021 06:59:56 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 0 X-KSE-AntiSpam-Info: Lua profiles 165566 [Aug 16 2021] X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: pkshih@realtek.com X-KSE-AntiSpam-Info: LuaCore: 454 454 39c6e442fd417993330528e7f9d13ac1bf7fdf8c X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 08/16/2021 07:03:00 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Chih-Kang Chang In ieee80211_amsdu_aggregate() set a pointer frag_tail point to the end of skb_shinfo(head)->frag_list, and use it to bind other skb in the end of this function. But when execute ieee80211_amsdu_aggregate() ->ieee80211_amsdu_realloc_pad()->pskb_expand_head(), the address of skb_shinfo(head)->frag_list will be changed. However, the ieee80211_amsdu_aggregate() not update frag_tail after call pskb_expand_head(). That will cause the second skb can't bind to the head skb appropriately.So we update the address of frag_tail to fix it. Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih --- net/mac80211/tx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 8509778ff31f..9e0d4fca1c76 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3406,6 +3406,12 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata, head->len += skb->len; head->data_len += skb->len; + + /* frag_list should be updated after pskb_expand_head() */ + frag_tail = &skb_shinfo(head)->frag_list; + while (*frag_tail) + frag_tail = &(*frag_tail)->next; + *frag_tail = skb; out_recalc: -- 2.25.1