Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5972894rdb; Thu, 14 Dec 2023 05:13:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHUO7Ta3y8dPRjFTHVqxxO+/SunObnhzWUu7OmreSa8+7LUb5UpvHOZMQ13kpbJVNqdtKYd X-Received: by 2002:ae9:ea0d:0:b0:77f:6171:1949 with SMTP id f13-20020ae9ea0d000000b0077f61711949mr8721043qkg.85.1702559632160; Thu, 14 Dec 2023 05:13:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702559632; cv=none; d=google.com; s=arc-20160816; b=WEUGAAx0ir8KyKmY0XAoRYpZ779sRytN1j8uKtAwS4vIL1DfSkRLN+e///nLt2vKya Em/dxQNkn9hsv6Y7/sQvXaMhOb74zKBO18DwqqoV/2kBjCTHbP1nzjzkE2ybyLGAL+x2 7kRFu0GMmavBTJNo7n/jgZDUCPVbiEounC712rAAXHmNYhbUTYjLpLTWl4KK4jESUsCj Afx0NE/1Uw7+8JlyyZW4KJI2C49KmJz7njzToNMVMhgE5ZXuaVWhTN9buJ4k9mRFB0CA GFd7yOwQitEHh4+zqHM8lFCpYvg6aCFiRAHuVPgWWKUd659IOHBKwuCR9Oxw+rG/OJgh E1eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=4AiPauWUi0ChdOBQScOytBHEebDUoedjiYB9gzw0gHU=; fh=wPKqJYWPZZBj1Xg2M1wyy4XV3htSN8PNQCzxJ7lg5dU=; b=Fle9E8lRmHOmeXPfuCaJIT68pGEnhmg0V2Xx2iZXWAwEu77JQXS/LU+rITUBxjFOBV RMAVE4o+27RRqctBZRFO8yPpIH8/rzsGdpS2CGhFgA68heSYpnPkYzwUglDiqjKy3GqU YMbM/BAxWaCzLaMOQhIQa9l/mxeLBoWFwKmfT/W259z2OVWQWuq6Ywkm3etkheSHgfT2 iAeTrwP3AnF2ZBN7qSUgx2CpSND/JJlZkXtpL9HH7LWbdYyC9NvRiWu/xegStvn9Uih7 3475N8WvotQhcNCKHYhWPkICliMDpM1S/N946NwDDoHaFwXJUuowfeaz2ZqYoeBy7YJ0 6z2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="fdyqlP/X"; spf=pass (google.com: domain of linux-wireless+bounces-796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-796-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pe34-20020a05620a852200b0077d7c33e00bsi5460015qkn.369.2023.12.14.05.13.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 05:13:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="fdyqlP/X"; spf=pass (google.com: domain of linux-wireless+bounces-796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-796-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CDC741C2087E for ; Thu, 14 Dec 2023 13:13:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E6925380B; Thu, 14 Dec 2023 13:13:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="fdyqlP/X" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61FF598 for ; Thu, 14 Dec 2023 05:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=4AiPauWUi0ChdOBQScOytBHEebDUoedjiYB9gzw0gHU=; t=1702559626; x=1703769226; b=fdyqlP/XELL7WXTFuzJWZ4ZwkvZerxNffIrZuWbtFSCzCz9 DBejbpPFJnzn3eIy0aJGm2UaiDob0b9tjkam6nYFcSk2gI1EveKZiSbMuyGL5eQgDSLeHqhYi5ogG UHekOHfdpoOZ/L8or4W1HyxPCjNoWNj9otUbbilNrfRLBCRwFbE2V4Q1vO0LKHI4e4rPMvOe62R8q lHNYdYlOzfIRUirQc5P0/0FT0G11lZ2qfe80QmpAlCE9SNWbe4fq0/3lodLLZqVYJT1AiZseyqGsq 433AqUur8ZCMbxzEN4xTXDl0RfIvGn/Rd49SzdLmdULNuPxumwYDuhOaBbGyNnIQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rDlX1-0000000AqXN-3FmS; Thu, 14 Dec 2023 14:13:40 +0100 Message-ID: <9d2e0cc7ec292a7a1ea26c43ada305f40bc22829.camel@sipsolutions.net> Subject: Re: [PATCH] wifi: cfg80211: fix bss rbn double erase issue From: Johannes Berg To: Jiazi Li Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jiazi Li , linux-wireless@vger.kernel.org Date: Thu, 14 Dec 2023 14:13:38 +0100 In-Reply-To: <20231026013528.GA24122@Jiazi.Li> References: <20231025103304.22082-1-jiazi.li@transsion.com> <20231026013528.GA24122@Jiazi.Li> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.2 (3.50.2-1.fc39) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned > >=20 > > Ok that's bad - so you hit the WARN_ON there? How that? We should fix > > that too? > >=20 > Yes, hit this WARN_ON in the test of direct connection between mobile > phones and PC. Here is the log: > [ 2741.982362] -----------[ cut here ]----------- > [ 2741.982446] WARNING: CPU: 6 PID: 2175 at net/wireless/scan.c:1496 cfg8= 0211_update_assoc_bss_entry+0x350/0x378 [cfg80211] Right, so you can reproduce that - can you find a fix for it? > I don't know why this is happening yet. OK ... We have some basic kunit infrastructure, maybe you can work out something there. > > > this bss->rbn will continue to hold > > > expired data, such as __rd_parent_color. > >=20 > > Does that matter in any way? > >=20 > It caused a null pointer issue in rb_erase: Well, OK, so the thing isn't about it holding a color or 'expired' data or whatever, it's about it being still on the rbtree, no? > > > And this bss still in rdev->bss_list, maybe double erase in > > > __cfg80211_bss_expire later. > > > Double erase a rbtree node(with expired parent and color data) maybe > > > corrupt rbtree, so add a in_rbtree flag to fix this issue. > >=20 > > This seems overly complex - couldn't we just remove it from the list to= o > > or something? It's already a case that "should never happen" so ... not > > sure we need to do something "good"? > >=20 > Will remove it from list when re-insert fail cause confusion in it's > refcount? Which could lead to leakage or use-after-free? > >=20 It's a warn-on anyway, better we leak it than crash? johannes