Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2469118pxb; Mon, 19 Apr 2021 06:31:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrKJAbaRR8oung1BP74Fr8vLWBtLAgCbHMTIrPBXaCvtch2XpaycIY8HIBRexpxvYY4EPs X-Received: by 2002:a17:906:c787:: with SMTP id cw7mr16328117ejb.157.1618839084636; Mon, 19 Apr 2021 06:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618839084; cv=none; d=google.com; s=arc-20160816; b=TIvYDPrKMZFS9mdkV6APNw+yUo0IViZ5GSxPTH8EjddfVvdTFaWKoC19pN/XxhJ+O1 Km5N9g38veCw82gLXrptCFn+N0LpFSP4N+3VxfNyG8/sm9p/wzzqqtrbPkrY6Ikf/Tm4 LH3WR/N+dHUiPh+tqV41AA/u8oYgCk0qVfNi3ebxsshgFvi5y23g5KEtXXGoXTlqBIuT rOGz5vYJd8+FaB3tCWWn5165X7isUUnfNEYooK+bRngQfgtvGJVErdNs1BlkOny6nWek DLfdLzvRNP9Re4j7anusZA4u0Y28jx7M7R4iC6DJirkpkQJxuh7WOzX+L9l3C3QEvE5B 7BVw== 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=gIRtDLSnQHzFI0eX7Dvopjo/W2bWKfwN2bISEiJrXUo=; b=ldLSf/ujvfC/dqAWKqspRI/RiUpscLB+v6VJaFeGV8xtALzp8SYjviyUkJLiJrFzva gu27u9PVIAsyUos3oYybrX6M1bfn5aNLjUxZYu6/mQQvUaC3dB2AeuzUMOXhH9/cyB/o QnoJorFrVz5ExNABSNYQk++bNGvDc76pPd1QVY0krJBZE3+Z3uZcfZeQlsmysTp803uk y45AGhAVCiEVLgdZBARB9BQnVBZHjAk2aFjrJ4rhny5Rhr8ue2F6EWVyMxANK6/9Liq/ arCefYWTge6urXzedBmp3+99sH4wJ/b0KOdH/0g3orCAcjiLPHbUVM7Gph9omXwzADt3 zu5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ikvARjaD; 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 r3si5621891edm.323.2021.04.19.06.30.58; Mon, 19 Apr 2021 06:31:24 -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=ikvARjaD; 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 S241235AbhDSN2Z (ORCPT + 99 others); Mon, 19 Apr 2021 09:28:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:56986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241411AbhDSNUb (ORCPT ); Mon, 19 Apr 2021 09:20:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B5B68613D0; Mon, 19 Apr 2021 13:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838198; bh=ApGNo6D8yr0HZwEQcva912dzC25IbHBL+pwMRahzdCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ikvARjaDFo3s3VtshOLKq8MBx/UpcgyOnHYesauDxwF8Wu06SjP0yXiwByE2jPvie YQ/HEsDUhnty3SDYONvm7aIprFPGj1Qxg0wq+xxchbs8uTTUR1n/1AmUPCIrAmvffI kb6h9TokupTUdGfYzauYkru/ep72ow6UTRRo979o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Seevalamuthu Mariappan , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 044/103] mac80211: clear sta->fast_rx when STA removed from 4-addr VLAN Date: Mon, 19 Apr 2021 15:05:55 +0200 Message-Id: <20210419130529.333045805@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@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: Seevalamuthu Mariappan [ Upstream commit dd0b45538146cb6a54d6da7663b8c3afd16ebcfd ] In some race conditions, with more clients and traffic configuration, below crash is seen when making the interface down. sta->fast_rx wasn't cleared when STA gets removed from 4-addr AP_VLAN interface. The crash is due to try accessing 4-addr AP_VLAN interface's net_device (fast_rx->dev) which has been deleted already. Resolve this by clearing sta->fast_rx pointer when STA removes from a 4-addr VLAN. [ 239.449529] Unable to handle kernel NULL pointer dereference at virtual address 00000004 [ 239.449531] pgd = 80204000 ... [ 239.481496] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.60 #227 [ 239.481591] Hardware name: Generic DT based system [ 239.487665] task: be05b700 ti: be08e000 task.ti: be08e000 [ 239.492360] PC is at get_rps_cpu+0x2d4/0x31c [ 239.497823] LR is at 0xbe08fc54 ... [ 239.778574] [<80739740>] (get_rps_cpu) from [<8073cb10>] (netif_receive_skb_internal+0x8c/0xac) [ 239.786722] [<8073cb10>] (netif_receive_skb_internal) from [<8073d578>] (napi_gro_receive+0x48/0xc4) [ 239.795267] [<8073d578>] (napi_gro_receive) from [] (ieee80211_mark_rx_ba_filtered_frames+0xbcc/0x12d4 [mac80211]) [ 239.804776] [] (ieee80211_mark_rx_ba_filtered_frames [mac80211]) from [] (ieee80211_rx_napi+0x7b8/0x8c8 [mac8 0211]) [ 239.815857] [] (ieee80211_rx_napi [mac80211]) from [] (ath11k_dp_process_rx+0x7bc/0x8c8 [ath11k]) [ 239.827757] [] (ath11k_dp_process_rx [ath11k]) from [] (ath11k_dp_service_srng+0x2c0/0x2e0 [ath11k]) [ 239.838484] [] (ath11k_dp_service_srng [ath11k]) from [<7f55b7dc>] (ath11k_ahb_ext_grp_napi_poll+0x20/0x84 [ath11k_ahb] ) [ 239.849419] [<7f55b7dc>] (ath11k_ahb_ext_grp_napi_poll [ath11k_ahb]) from [<8073ce1c>] (net_rx_action+0xe0/0x28c) [ 239.860945] [<8073ce1c>] (net_rx_action) from [<80324868>] (__do_softirq+0xe4/0x228) [ 239.871269] [<80324868>] (__do_softirq) from [<80324c48>] (irq_exit+0x98/0x108) [ 239.879080] [<80324c48>] (irq_exit) from [<8035c59c>] (__handle_domain_irq+0x90/0xb4) [ 239.886114] [<8035c59c>] (__handle_domain_irq) from [<8030137c>] (gic_handle_irq+0x50/0x94) [ 239.894100] [<8030137c>] (gic_handle_irq) from [<803024c0>] (__irq_svc+0x40/0x74) Signed-off-by: Seevalamuthu Mariappan Link: https://lore.kernel.org/r/1616163532-3881-1-git-send-email-seevalam@codeaurora.org Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/cfg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 2bf6271d9e3f..6a96deded763 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1789,8 +1789,10 @@ static int ieee80211_change_station(struct wiphy *wiphy, } if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && - sta->sdata->u.vlan.sta) + sta->sdata->u.vlan.sta) { + ieee80211_clear_fast_rx(sta); RCU_INIT_POINTER(sta->sdata->u.vlan.sta, NULL); + } if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) ieee80211_vif_dec_num_mcast(sta->sdata); -- 2.30.2