From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 372243B5DED for ; Wed, 10 Jun 2026 08:52:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781081542; cv=none; b=IpsjU9JoV15bhRhkrGaduLZngBk7gDd7cExZ7VQck8zzPZgyJHMb6ZJAhNP7KJ1Q+ehCNqX+AwXL2Y9P9/GI0vdpnocj9VJhCbZj8viKSlKyh0yijVZQAQDQGKaIDvvstAD61QYi2aeb1YqAKhX/evxwcWJEhHKjZN01K3MJA2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781081542; c=relaxed/simple; bh=005kqibYyfonRcnHCwlpzKy2wPXsZAtXExaHgcOqx2w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=fvyihhm4BFvxfhQonOp6Y9JT+oBFtO+mLBRz97T20BPQa6/hGg+VnYXYRueugVak1VqkqlQCM7ertVL6suNHcOtbGDaj1Rr/DDAmOF5WsjlitYipUiUNiRHsR1SvgYzkMZipYBQzMWZ9mtsr5+f0vz+eCkyRzJxsAm0BpbavoYM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com; spf=pass smtp.mailfrom=6wind.com; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b=b4GV6tBf; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=6wind.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b="b4GV6tBf" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-beb2063b149so95142966b.2 for ; Wed, 10 Jun 2026 01:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1781081538; x=1781686338; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:content-language :from:references:cc:to:subject:reply-to:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=keO9Q9d4wSuesQmYGtEo2JR0GnYAaSiDUln8Q5/lybM=; b=b4GV6tBf8+7tjGcAO9sUPh2xtm6sI1zM6D8eeaNJkPftnLoMPvNmX8ID/7bvE6Cqnb sEcLO/J1Exie2QtMVAGJf7V5ZSedoLe/LjdOb9cEzU7igO0jRrIvSKexonPQhP22HGxM d4wkJ986PCMGH0BB+ReJlaooXGlHBkpmScm72FJTNlSg1gemxi2yiswtUnVc62iBjJZJ DTJPAG2aLhKmudxn8lGpaAJwS2mqJOHPPM53oBRJuhs0XXO4rsAQm2Vxz2h36og7MVP1 65naL/qvhYfnLKPHKRjjCy4ERbujPNTcQ9je/BzDpUfQgOHHXWHcFl8gpKBX/Vl4kwNN sfgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781081538; x=1781686338; h=content-transfer-encoding:in-reply-to:organization:content-language :from:references:cc:to:subject:reply-to:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=keO9Q9d4wSuesQmYGtEo2JR0GnYAaSiDUln8Q5/lybM=; b=l7lqSFwRzI7Jvr5YCDHrsyKjP1U+YZwIC/fbXV5xafurfs7mMgH6J2v6B3yOi2RPcd /18DL4zL9IztwK97E+3yVGj+lyTSOCnrlrX1zgTnjrBfHqIoGLfkUsW7++/YYhe+Mc40 3jAM118drSOvXMg9t/S3xZH7V1klW72aG1IitC1OywzC6LAbTbQmO83tLpaJSAKlubV+ D7de5X7HXshSQqFbRZlqcHfb5VVQaSGNr7Lzw8ma2nMVMbbDBS4pMsNyC4PQ7vKrL3rY L5PpsLNiM3B5WL0t+wT+eCdX84d0JDHjNm8VBADn8uYaWt4OHikzzbQgKdXDvcRDynO5 KfmA== X-Forwarded-Encrypted: i=1; AFNElJ8E8fk4pXJi9ey/ZzsE680mWCLvkF//saWp5+jWvWc17YPjfMJxhuRsBLMLXWRMqhTudwduSvdzhyRlu5Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7eWFq07BoXDEpsq7oE8DU9c5kN/BGEmMZlF/5sjCT7HomOcYP Y4HsYYR7izLK74W5HZgC+0XWttIVSocQ47oDEPU9Q2oviQXWhb8v3GR0di/g1p8FGUU= X-Gm-Gg: Acq92OH/crrRyMypW+LhwmEuF82MrCG0V67eDCBka4dbRmfuo1OfvN9XbAQo/XF4+1M GPOUPZ2j+MSti9/Pcld5v4gWU1XAQed+IRwswV7ICpnJ6tE+V6m3Wn4lHJpZo6TbkDa0uCpD7Yn DmqX2Ayr2TQd1pK3p3eIQ/pj2yvQKNNDDexcjDyaIBjGoIpkmzwm5wd4Hqn2aKU4Mx5ptZYo3ts mS8PtKZlhQx6Od73c4X97xfv4qEuLIfiriI8Ohrwr5YmKkKs5h/CAGAhfm+Tg0HOCfOl3nMkBlj 6MrNmZQ9wThgtYzssUELuE/lu1hgKx/OWcji9y3+wqoiJIFBD8y8RiXl+NiW4rv/C30orQV9N6j cjI11613N3zoP7MiBvBnDwtu51BO22iuuaHzFljQlckg/DnJ7QLDfE1iXaD3ZW06YB8V1ZrG5IK 9GwrKPo4jL2Rt/7bF2t/zndjnWaAXyvrNZhxDh+AH1fvf7c8ydNEToMmI8AOF6z1clMZb0LhGqP ZmwtCZdutwxZnc= X-Received: by 2002:a17:906:5a61:b0:beb:7979:47d5 with SMTP id a640c23a62f3a-bf93a7144efmr115138566b.6.1781081538525; Wed, 10 Jun 2026 01:52:18 -0700 (PDT) Received: from ?IPV6:2a01:e0a:ab7:2110:6a1d:efff:fe52:1959? ([2a01:e0a:ab7:2110:6a1d:efff:fe52:1959]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bf054e05199sm1125952066b.29.2026.06.10.01.52.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jun 2026 01:52:18 -0700 (PDT) Message-ID: <5224a3f8-16e9-4967-9fce-14e1a0fc5205@6wind.com> Date: Wed, 10 Jun 2026 10:52:17 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: nicolas.dichtel@6wind.com Subject: Re: [PATCH net-next] ipv4: igmp: remove multicast group from hash table on device destruction To: Yuyang Huang Cc: "David S. Miller" , David Ahern , Eric Dumazet , Ido Schimmel , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20260609122646.2297540-1-yuyanghuang@google.com> From: Nicolas Dichtel Content-Language: en-US Organization: 6WIND In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le 10/06/2026 à 10:37, Yuyang Huang a écrit : > On Wed, Jun 10, 2026 at 4:50 PM Nicolas Dichtel > wrote: >> >> Le 09/06/2026 à 14:26, Yuyang Huang a écrit : >>> When a device is destroyed under RTNL, ip_mc_destroy_dev() iterates through >>> the multicast list and calls ip_ma_put() on each membership, scheduling >>> them for RCU reclamation. However, they are not unlinked from the device's >>> multicast hash table (mc_hash). >>> >>> Since the device remains published in dev->ip_ptr until after >>> ip_mc_destroy_dev() completes, concurrent RCU readers traversing mc_hash >>> can still locate and access the multicast group after its refcount is >>> decremented. If the RCU callback runs and frees the group while a reader is >>> accessing it, a use-after-free occurs. >>> >>> Fix this by unlinking the multicast group from mc_hash using >>> ip_mc_hash_remove() before scheduling it for reclamation. >>> >>> Signed-off-by: Yuyang Huang >> A 'Fixes' tag may be useful for backports. > > Thanks for the suggestion. Per discussion in the following thread, we > don't need to add the Fixes tag for a trivial fix. > > https://lore.kernel.org/netdev/20260604101728.GA771160@shredder/ I probably misunderstood the commit, but you are talking about a 'use-after-free', which doesn't seem trivial for me.