Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp223283lqb; Sat, 16 Mar 2024 01:07:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVgJSGszNwTxCs6NF4Wbo+bT9HsmU6rFD+Q5Ws2laHDqOFijESy/PtI6cymLNNnA1ZxJaKUfqmN1GfupHsXjhfNtbjKqwCgGSrjMMwYNQ== X-Google-Smtp-Source: AGHT+IFR+/dlANzTjq7kVqQNrC/JfdkTU6oal78JG6HL9FBmTM728376UJPhEGUjFICZBbZnBJq+ X-Received: by 2002:a05:6358:1282:b0:17b:f6a9:dc18 with SMTP id e2-20020a056358128200b0017bf6a9dc18mr8457381rwi.15.1710576436472; Sat, 16 Mar 2024 01:07:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710576436; cv=pass; d=google.com; s=arc-20160816; b=zwIlovJenFhs8mSgCrEPC8TMHyd7Rp4wEN2Iymjf/QKOmi7ikouUvGDg4zlCH51gxE JNVeh5IWXkoch0QMgAgBuK/A8Gq4d9ne71doeLKgGh3l+IvNuR5ckjhwyCB0piig6WRL s9Svm4KaznK7119N/7UtqRISxurWrnaLc2Ye5VdS+gHoEnA9QreWK1mLmvvKlmzUy36k BUUSKi+6Pqqaj6ovyWYOvM2ONq5nlpMSkd7hQtV+F+ppPx8qMm/ODCCX8DOhAmRw2rMO SBKX1phWg4gOXO2zyfZKGgQfxHkL4/TpDGzZJTehFvGu8nlxHNIA4r5rTpbTOACNVMgW 1udg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=8gu6F+HwtRJvcvAIGUPu2uMMb2AS7khduuvgjS0HqLA=; fh=KUmwsLzLkhXVl2jJ4u39Wpqo57xilkMpy8GHdaLYkMM=; b=zcY2Y8PfCjMrYxM5rI4lvJwrRnyzUHzw6DipQSM8riVasNDvLjZJEJuqZYefDilWdf Kd2XFk6AqJmxLXdhtZVX1V311+HWCN/FO9sAQiRXmFBxwHHtyciJ2pfCflNCtz23rWKx pc8oMekcr10LIkRpsn9dIsfBKSiJd35CSj/EngSlrlWfd4U8C4h/Mi0/qbpLWX463UaN +VBzeH+/Y+Uu2xzp7YKP3pFhp4N1CUaiQFXh8jTRlXmdRQ8kfRQzbLgZomo7ivxL06T7 45GK/6fvftFmWjcOyQu6utpSdjWfGgvZNFGvtaL4l48XTZhHiBbFjEkq1vAlecrqmhwk D4zw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=IKi0wQkm; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-wireless+bounces-4801-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4801-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s7-20020a17090a440700b0029bb484d1f8si4059466pjg.120.2024.03.16.01.07.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Mar 2024 01:07:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4801-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=IKi0wQkm; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-wireless+bounces-4801-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4801-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6B56B281CC1 for ; Sat, 16 Mar 2024 08:07:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CCAD14292; Sat, 16 Mar 2024 08:07:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="IKi0wQkm" X-Original-To: linux-wireless@vger.kernel.org Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C50A514285 for ; Sat, 16 Mar 2024 08:07:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710576432; cv=none; b=aH7N3QwvNzhoTI6ZF4nEpnX/2dvoVB1wih2d/KCuZVFPfHbSl84t2m9YtThkoaoS6bYgvr2DCJYKmVcIYXQWDjN+Ub5ALaRcyltIO85ajVkiaRhIvICIz55Vn0ru7BJzFL51U4bX05du5xfoYRCc+Z/NOx92NxPYwy/9rg7HZbs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710576432; c=relaxed/simple; bh=EcEqCt/gI5CKrSy1aUfIGsP28LobZx/2/cc2QtK5Iqg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IcUCtjhcu+FWupgURIiZ84j2rVJB1vV29D+vVAd+4JNQZIgrLFkqItbxSxiWh10Dp24BhmKpPCsQyXhmGF+akvTpHzoHRfshvg9l6BI/gzQzgExBUW1EpJx/ErGDJtqGas+R1MHcoHHPcJVrOn6rkHZ2xOrrHrbiRRB4F8rG1Fg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=none smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=IKi0wQkm; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=nbd.name DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8gu6F+HwtRJvcvAIGUPu2uMMb2AS7khduuvgjS0HqLA=; b=IKi0wQkm+pNQg+4CzUlhSqtoxe xgrEjFyKtWuqJVpLITPLJQUGTOiZtpXqLIdhjnCvWoLPcuCBaqU2oN0yVT+Vvui3GBOWz3EDZF9cJ LxxpAIpRTgQ/BEeMIhzk2D5336X1iym9RYzQiDBLPaELA6t8DLQVV13BL7pYIlqhGDT4=; Received: from p54ae9e7b.dip0.t-ipconnect.de ([84.174.158.123] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1rlOhd-006OCE-4C; Sat, 16 Mar 2024 08:43:37 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH wireless] wifi: mac80211: check/clear fast rx for non-4addr sta VLAN changes Date: Sat, 16 Mar 2024 08:43:36 +0100 Message-ID: <20240316074336.40442-1-nbd@nbd.name> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When moving a station out of a VLAN and deleting the VLAN afterwards, the fast_rx entry still holds a pointer to the VLAN's netdev, which can cause use-after-free bugs. Fix this by immediately calling ieee80211_check_fast_rx after the VLAN change. Cc: stable@vger.kernel.org Reported-by: ranygh@riseup.net Signed-off-by: Felix Fietkau --- net/mac80211/cfg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index f03452dc716d..f67c1d021812 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2199,15 +2199,14 @@ static int ieee80211_change_station(struct wiphy *wiphy, } if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && - sta->sdata->u.vlan.sta) { - ieee80211_clear_fast_rx(sta); + sta->sdata->u.vlan.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); sta->sdata = vlansdata; + ieee80211_check_fast_rx(sta); ieee80211_check_fast_xmit(sta); if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) { -- 2.43.0