From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 B0302221F2F for ; Sun, 29 Mar 2026 08:47:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774774061; cv=none; b=cdRlUEwuBQTI7Is6tGKp6Dv4Em5l01T7a2YZu3wnGOxDFArW411qWSvQnwKN7TfpTYHEvFRPoV+7xqgsqQTG6GR1QIALjbPhOfGXeUla95IXTjX3NHhQ2vyYvshIHVXZQWZnS4zsVcmlQU4Hjbhf/1HLjXijhmaO1Dry0PwfROc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774774061; c=relaxed/simple; bh=VSNeHqGQi5UQv8ev4baa9U74XQptxaGjHqWdFvbM9Y8=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=aKD+Wsuxg2Uy16VADeBRH5FPpsIqu70m91I1k4YF6tiBw6LfYVXEjqfxP0P5zQHv7WLRJwWfbMHZ5fItLFEVN2yyBaHAyv7VDtOPaGtbZn3md1wi730taVyhBuqMPOvSEnWRp4ruxxz2iw/CMG/X+nz4kDTT5N9LTth43nM1ArE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4852c9b4158so27746335e9.0 for ; Sun, 29 Mar 2026 01:47:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774774058; x=1775378858; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nh6wi43WlvRbTT2tXYoTLwx6uE0Pvl9KzxXhavo8nbU=; b=YKmrMMuMhDugM8lgss1bxTC2Yz+wlTLLxcjPFup4j4FBX3pqvQXXUemMHE2+un/DJN fNEAM+rQI+FoxePRll74dXE+HIj/s2XzOqDnoZl8hMoO2c3sdw3Wms4hxXOIgdgcFuAo Ib3gjfQzXtSf4f6Jcxvvflu3YtokT2F5kNXS3mWKB/OS8SXjYGSvox/KEJbTq+dQ2/Bu ot+BslvuLeVuUsw6SBp458vAIQoYjZhecw0BzWpQqCxORpTlKaEKqiUZJNAg2ANH3Yi0 Fd2gEl3RF2JJE+5noh/RcmiXxinsHktSnWNGas/4YBfH9AaWe5F4hHD+8me9hAgp8atC BnIw== X-Forwarded-Encrypted: i=1; AJvYcCUnsVS1lOQNt75jVomzQOs6rMFS+3Nx7kl96pCJ74pT+BUilfRsH5Alm5kt9gDmrMnhkfRMwfFKPJ9Yq5U=@vger.kernel.org X-Gm-Message-State: AOJu0Yye15a9JA6+l31mDNf7ppsnsIVZfoZ6oQ9annkFll4y0rJA1MJl qsi3xgviATGDzFX2rVf++qU3A1lBupa/rueX4uXSfkXC70uUqOiGqcEB X-Gm-Gg: ATEYQzzzjHksDMWm+Jw9RB1hUo/9j1LquOtVHFWc3DUUstxVOSKnDNCfzxtn9CqBzth pt69DP+opra3z7EkxVVFmFyCXEycIrhUOQx87vxlcr675IeW7UwlQ8LAxaxfFZSdsXyXISpohjS E3xWq5FgUiP7qvuR3cTozJSLZyqDBRY8Pb4tOdaKFFK8XCvYp24q6/gxP2uZxvzcR+c5AF0v3Bo AsTgTjaPHa/s3WtDLebMtcdyxl+fzDhbRLc/MCmRPfy2T3e7nDleFq4warrB/XGJicHDh1//2Pt SG//Z++tHIBW36DrEIUiO5vVVKtOPt0wSKGJ53QpXEDQ1DzV8p/RbkOwvqQpGhmTqsytxf7VTsX FhcYZoyoPW9Q6d6EFQOMyaF2EOBcpmI7809Dff16OHCXGuoBVyH9MRjM5uUjUp/0kfdkgWowpGD 8y93lfLd9Tz7WQgx4oHbvTpTblqePRBjkY5w== X-Received: by 2002:a05:600c:64c8:b0:483:8062:b43 with SMTP id 5b1f17b1804b1-48727eb7f4dmr138474605e9.19.1774774057894; Sun, 29 Mar 2026 01:47:37 -0700 (PDT) Received: from ehlo.thunderbird.net ([94.156.174.93]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43cf245f8a3sm11258404f8f.24.2026.03.29.01.47.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Mar 2026 01:47:37 -0700 (PDT) Date: Sun, 29 Mar 2026 17:47:30 +0900 From: Alexander Popov To: Jakub Kicinski CC: Andrew Lunn , David Miller , Eric Dumazet , Paolo Abeni , Simon Horman , Maxime Chevallier , Michal Kubecek , Gal Pressman , Kory Maincent , Oleksij Rempel , Ido Schimmel , Heiner Kallweit , Greg KH , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, security@kernel.org, notify@kernel.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH=5D_ethtool=3A_don=27t_touch_the_paren?= =?US-ASCII?Q?t_device_of_a_net_device_being_unregistered?= In-Reply-To: <1c41e408-15f2-4c83-8a0f-24b46b1ec1c1@linux.com> References: <20260322075917.254874-1-alex.popov@linux.com> <3c07c51a-421b-456f-9819-9021ddd7b22e@lunn.ch> <20260323150827.24a6259c@kernel.org> <1c41e408-15f2-4c83-8a0f-24b46b1ec1c1@linux.com> Message-ID: <676733D7-814A-4B66-9E49-93DD1259ED48@linux.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 25 March 2026 03:46:20 GMT+09:00, Alexander Popov wrote: >On 3/24/26 01:08, Jakub Kicinski wrote: >> On Mon, 23 Mar 2026 02:08:53 +0300 Alexander Popov wrote: >>> Hello Andrew, let me describe the scenario that I see: >>>=20 >>> - The netdev_run_todo() function handles the net devices in net_tod= o_list >>> in a loop and moves each of them into the NETREG_UNREGISTERED sta= te: >>> netdev_lock(dev); >>> WRITE_ONCE(dev->reg_state, NETREG_UNREGISTERED); >>> netdev_unlock(dev); >>>=20 >>> - Then netdev_run_todo() frees these net devices in another loop=2E >>> On each iteration, it chooses a device for freeing: >>> dev =3D netdev_wait_allrefs_any(&list); >>>=20 >>> - At the same time, the ethnl_set_features() function calls >>> ethnl_parse_header_dev_get() for the child net device=2E >>>=20 >>> - If the race condition succeeds, ethnl_set_features() takes the re= ference >>> to the child net device being unregistered=2E That makes netdev_r= un_todo() >>> free the parent first=2E >>=20 >> That's not sufficient detail=2E ethnl_parse_header_dev_get() is under R= CU >> and unregistration does an RCU sync after delisting the device=2E Also >> not sure you're distinguishing struct net_device and struct device=2E >>=20 >> How did you hit this issue? What are the net devices involved? > >I've provided additional details about the reproducer of this vulnerabili= ty to Jakub and to security@kernel=2Eorg=2E Hello! May I ask about the decision on this patch? At patchwork=2Ekernel=2Eorg, it is marked as "Changes Requested": However, I don't have any instructions on what to change in it=2E Thanks! Alexander=20