From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 405DE3F788F for ; Tue, 25 Aug 2026 10:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787653391; cv=none; b=gO2KNDxTmfhg2rSJVfU5W8y27wUsGKcHwm5Qz6B5dizW8iZ4F2iLlBoxNSWcsHWdX2mD6/+b9UM9Cd3dj2YMPJyEHnzgmjc18ZIYEfJ4ie6KkfUEWggNKNYpf57FlCzerdXa/KKbvCM5zA18uLpR23zDdACpIw/fpDJK5FZel+A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787653391; c=relaxed/simple; bh=lqMXD3suOr+sitndCEj6l9BWxP7uFteuQLonBXuJZuY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gPzzexoq+KnjFR6E5pw6ONEXjmi+qFP+5sz/eVtMj6DRzcrCgh/6v3S7syftNROhofpuN78Ibjuknf1arEzvOn/OZcN1merQ640sssAmZJEfPbnL0PXYzgL29wPSwJYPVSE3v65sTru8OCAx4PPKnYyoN9SCecIpRTX/f47sdjo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=blackwall.org; spf=none smtp.mailfrom=blackwall.org; dkim=pass (2048-bit key) header.d=blackwall.org header.i=@blackwall.org header.b=Df/oG2tj; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=blackwall.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=blackwall.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=blackwall.org header.i=@blackwall.org header.b="Df/oG2tj" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-6a3e145e1bfso6128899a12.1 for ; Tue, 25 Aug 2026 03:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall.org; s=google; t=1787653388; x=1788258188; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=h4FFQMfXNiGpn+c0Ds6FNCWxiddPqnNk/uHSviV3ZIQ=; b=Df/oG2tjxtynxlxuivyAAtjvRVH31qMGGeAuXoTG47ewNzfIzWt14mc3N/Z4MpTVqP 9E2lwuLe9H9xw+fQomqc6GzjvtORRHl55oitVz6UAL4ixQvmVgt+u3JdHglM0WpJ65DJ dhZSy7vwvRwihQH5o42oN5PYQo7DGYrp/XuzXSz5uyb6EBd/q+uzQwvUKxgbPreH7Q1S SADj7UtJ+rXFcS9IiWAM9JRr1X1ZdTLyk5XE3bOB75TrW6+7g20dZRdhJ6cVmh0bYfHE tBvOFnvNAd6Cu5+zrR5QbgzfSaUI83v0Np41maB/z6m1pN9bdjOWjBchPAc6nF6RynF9 tzyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787653388; x=1788258188; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=h4FFQMfXNiGpn+c0Ds6FNCWxiddPqnNk/uHSviV3ZIQ=; b=V3YJGTWqn6e5pKW/cNAMlKFROG3X1hiPPOcuQwjTRBsSIJag0So94V2FvngRBPpRaM Red4oA/qLWnNlSwijwOc36qwjzj03bmJfHv068qt91J8D3jieuxQJIcyl4VYeeR+BTu6 MraGTAxu5hhklKw4Abk0cth3dbEnv+5HN05T21Sc9NZkAVCv2/iUKqBBsc3XrtJzzerS +BsFXUO9MOdaKyzH4VEfie6LjtydBh59bJH1qWxEzVNDNKqOXG6jap0gpIGh4FBBP+7J BTjyW3jIDxVBAiynWEvMIWfVFgP5BCXXOVIPSgGmwDqCWNA5PGv1fuD78gUHZGEQqC7U RhOg== X-Forwarded-Encrypted: i=1; AHgh+RpLVfhAEHUE3LVS49k2gFWDoPXD1OjCv6H2KgAA3kUYt1yj6d93GDCwKisgVkuJchsm5QP2HR4CMHy6Bjs=@vger.kernel.org X-Gm-Message-State: AFuF++n7zdwW8eXgTtFG9IEmUGvqZWz+UqLIFKuoZvuMQNpbdeHu8VPD UkYdk7eT5UA7OmcyLZNAd2fCTWTpOfSkrOF7pPiCDClsKmFvwed3kRgo5Vp9ZP6b9BU= X-Gm-Gg: AR+sD1047ZUJsTJkfoZhy5at2+7stutKm/njnasDNaqlz5z8H7eu4xQzgzCubyx2Qw2 S4AsX0APiTCjnxhvksPnrqZErvBJ3fKgoxUgL5Z/h6m/2PL5WuSMDkataTXwJ3XSIVuGZp1TAJS dYnRySLfWBeamCL5eHqBL48H3iLe//MNFsGvSb0sQHhRaOO1ZtUTcVrdKC8B+Kl+DNQvcjYHkNJ Kzdu/p7c6XWubbo39C1urnZAtxZkzvHVB7Ji9a6lCzgcGueUFflrbcv9vIadvctbJ/qNUsG2swy nR5nBj3ml68az0RdXPchpnntAQ+7KXhqaXeyD6ZU8vI0Rz4w54TUCLws3VVHIjvPV4LROQGDzF0 o2mpH7/VKPxiB3KbFLdt6bb9JMNpgAtEy9f+puCeEqlYu/WK0J9EYEkAWCzrYoTyLOcvsXLYmK4 Uq2iX6lXV51ky7hGYKv5gzvWd5vqwzjXMevHkPQV6b/jioi11avIeqaTyd3YzmtwzeuEDZdUzIJ dGEpW3LRaPa/PAabeg= X-Received: by 2002:a17:906:fd81:b0:c21:35d0:f43d with SMTP id a640c23a62f3a-c246a6c52c2mr3630062566b.16.1787653388035; Tue, 25 Aug 2026 03:23:08 -0700 (PDT) Received: from [192.168.0.161] (78-154-15-182.ip.btc-net.bg. [78.154.15.182]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c249606a8fasm1880346766b.8.2026.08.25.03.23.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Aug 2026 03:23:07 -0700 (PDT) Message-ID: Date: Tue, 25 Aug 2026 13:23:06 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: bridge: mcast: don't truncate the port group walk on teardown Content-Language: en-US, bg To: Jun Yang Cc: Jun Yang , Ido Schimmel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , stable@vger.kernel.org, TencentOS Corvus AI , bridge@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260812113435.1854275-1-junvyyang@tencent.com> <5fddb18f-8ead-4680-ad7d-82123966cfa4@blackwall.org> <19b05984-d67c-4c30-aec6-ee8e8be554d9@blackwall.org> <20260825101954.3799675-1-junvyyang@tencent.com> From: Nikolay Aleksandrov In-Reply-To: <20260825101954.3799675-1-junvyyang@tencent.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 25/08/2026 13:19, Jun Yang wrote: > On 12/08/2026 15:21, Nikolay Aleksandrov wrote: >>> + /* use _rcu to preserve the next pointer because it might be in use */ >>> + hlist_del_init_rcu(&pg->mglist); >> Just to be clear - I'd expand the comment to include why it is safe to do >> so and under what conditions (multicast_lock held) > > Thanks Nik, that is much nicer than the restart/checks dance. > hlist_del_init_rcu() works - the UAF splat is gone (7.2 + KASAN). > > Before I spin anything: would you like me to send a v2 with your suggestion, > or will you fold it into the open-coded-list cleanup you mentioned? It is a > UAF with a Fixes/stable tag, so a minimal v2 now may be the easier backport, > but I am happy to leave it to your series. > > If you do want the v2, here is the expanded comment I would use: > > /* Keep ->next (held under multicast_lock, freed later by the GC work): > * a port->mglist teardown walk may have latched this node as its next, > * and deleting other groups of the same port must not truncate it. > */ > > Thanks, > Jun Please send v2, I don't know when I'll have time to prepare my changes. The comment sounds good to me. Thanks!