From patchwork Tue May 14 01:20:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-CY Lee X-Patchwork-Id: 1936087 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=hH/noije; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=cLHjuJ0v; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VgHlb6QXfz1yfq for ; Fri, 17 May 2024 03:54:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qZGmBvFgRW6qxVLUAWLFtoi2s6PN70dCKwiZnL52WG0=; b=hH/noije4+pMmq uDXmBLmNbU2a4FVuWPMluNp1KvDZtvSVJzrqmMihpz08ZUd5TwiMvTChMaSghvGr6kc16HbjjW5/f AdNwBqivwQGWmEDMdQAj064VZoqcn95FwqXkt5cVakz214FcL1623voPTAjL1mqlOmSJN+pJ8A3Kq xVgfqeXxNJFX7TTlCrhyd/OycMuWtI+Tp+wOAfXWNaT7lEgZSCtsyaRh2TSxLVdGouXhSwhQzEFL6 BvrVg3mgsJMFhw+hr0cTNQDPMQZ4mELgeMY0sADMSpNwsh88t0b7yv6SyGKNnGV2mSZxV5r48s79j MqE+XC0R5+QRJhsxx7MA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7fI9-00000005jWB-1qs5; Thu, 16 May 2024 17:53:21 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s6gqe-0000000EhN2-1drH for hostap@lists.infradead.org; Tue, 14 May 2024 01:20:57 +0000 X-UUID: 327cce68119011ef9a78ddf43a9225dc-20240513 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=mFd1Q230DjU4gK8kaLPuq3w8lZjFtInjfnkSvX2wAO8=; b=cLHjuJ0vBgfB8j+lmS2ID8X+caRWbiN3HthuFEq1cgceEkiVmatKOiEWUt05dEowfqLWO1EzbcQlWTe+UaT+rfK6IuXxrBRpCnvkj9cs7Qkalbl1lHquxutpERTXEKFwjN4SE1F9W7O2dfX1+1bGnj3OsSsDkRwbBtjsFbCL6tc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.38,REQID:7754bea2-8956-40d0-a32e-f30d1ff03afc,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:82c5f88,CLOUDID:be82cf83-4f93-4875-95e7-8c66ea833d57,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 327cce68119011ef9a78ddf43a9225dc-20240513 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1765185131; Mon, 13 May 2024 18:20:49 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 14 May 2024 09:20:46 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 14 May 2024 09:20:46 +0800 From: Michael-CY Lee To: Jouni Malinen CC: Felix Fietkau , , Aditya Kumar Singh , Evelyn Tsai , Money Wang , Michael-CY Lee Subject: [PATCH] AP MLD: reassign drv->ctx correctly to prevent hostapd crash Date: Tue, 14 May 2024 09:20:35 +0800 Message-ID: <20240514012035.23132-1-michael-cy.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240513_182056_462789_C87F1114 X-CRM114-Status: GOOD ( 12.31 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: When the first link is deleted and there are still remaining links, drv->ctx should be updated to the new default link on the bss. Otherwise, drv->ctx points to the address that has already been freed [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Mailman-Approved-At: Thu, 16 May 2024 10:53:18 -0700 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When the first link is deleted and there are still remaining links, drv->ctx should be updated to the new default link on the bss. Otherwise, drv->ctx points to the address that has already been freed and makes hostapd crash. Fixes: d2b62b3fe500 ("AP MLD: Support link removal before removing interface") Signed-off-by: Michael-CY Lee --- src/drivers/driver_nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 149f51a74..166aed7ad 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -10740,7 +10740,7 @@ static int driver_nl80211_link_remove(void *priv, enum wpa_driver_if_type type, bss->ctx = bss->flink->ctx; - if (drv->first_bss == bss && !bss->valid_links) + if (drv->first_bss == bss && bss->valid_links) drv->ctx = bss->ctx; if (!bss->valid_links) {