From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 59C9E35DA40 for ; Wed, 12 Aug 2026 01:46:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786499185; cv=none; b=e+aoqGJ3WT3QsdtrLPROb5K8TlAozJWIeg0USmkQCT3jE9b8ZehgrCQ0BKXeVCR3CnqGDoYBrL59olWzXYit++A5rQz3Ermnhb8siD/0jTW2LZdh57YrFab1qAzpYrHm67UG0QkRyuErlmAmy91+8vzQKjKO6Yw9mEp0F5GfnHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786499185; c=relaxed/simple; bh=hxEApRKDBN3eQqtZvQgwtEQk8NKI0BC7yptrO6X+1zc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WDaDqMPwf5LbKcjA3s9/4qOwu/dCGHTkWbPvfIDFiv1yRTRsg50aFIbCYWkd4ff7NGBkc0SIqMrWVBr36DEAef+apSJKYZE5YB1rT4XwotQBbq6ZMiyst7gru2snA/INkmQY8kQecmSTZh1oI/8z+J704mkCwmrlci/LSejb8a8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ar/arSOh; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ar/arSOh" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-8487214ad2bso705100b3a.1 for ; Tue, 11 Aug 2026 18:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786499184; x=1787103984; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=DpvSiMHFWPGGvTCvJybQfPYiAi3zlBmKnJ+fwsXosYY=; b=ar/arSOhwnWBLS3qZGUHxSs0XEmmZ3Il3VcuidUM4mE47vN5JRhnY+lLTXBKYn71Hu SBNPH73bPLPMxOyNInf+Ackc+tHK8PubPYiWde16V6bhaZu/X1y7g9fEWNhpV7+M8h0v 0vd+QsTOgJxSdoo0RRuxC7MOnO1zLdi+YUcU4AzkNTrBGjXNKdzZtStmLZHCw1k7ck5I Uc73tSOF3Nd+tl4QeIq+pvzW4EVmoea4ftjzhwDUiLPa/OJqr24NMckZQk+RU89awrdU rzQT4QfGen8bqDeLP0j64rOYNn+/BnPq6Fzd5mFKrvb1hKh0myBG6Wk9T+zzNPnUTRyR 4s9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786499184; x=1787103984; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=DpvSiMHFWPGGvTCvJybQfPYiAi3zlBmKnJ+fwsXosYY=; b=GJY8rAnM8bhUqWWuDZS3lX74Zu/3KVPRiWTf5ulp5QeLohod4n/2UItrErkE7jeBXj oh0om3KWcFsNFfXOKRH+kFvO1QCTa4SbvEcI6jkn9SCSQPm4Ns2FqbwwSBwnf+9W4pEh jWOgLIMc6xNv/RdVDrscmhl+l1mliLnC2C1tYo6pfHLhIXrC+MOmafRf6kFpdFe85hPc 75HZoYgu+h4jniJKW9MTZyiRnx0JFtkyJbpyKQqflZqsK28ybwjjeeCPyOJgWV4w9rvS S/VSvM68oOtZiMwZDEh51wiVc2O9nl8Jc31hLeMduQ6+ST0VOXzgp8vWp28e+Yj2qERq Fz+A== X-Forwarded-Encrypted: i=1; AHgh+RqyMZpurMjBR7Cj/bNlgKOvhUV6Cq1EnAT2lWdUW9+5evVC3znBPshRSqeqTt2Z6aWAG+h0o0CsxixX+Cg=@vger.kernel.org X-Gm-Message-State: AOJu0YwyZPPukEwBxNAQrFJSvzv5iL6HyfeqigAOixxiOvQzXRsg9Ixh eUWUnsa4utj7nTFGstzvS/lyt9H2jEbR4dJ6CE2CLds/wXsNMrlYbqbTzeBZLQ== X-Gm-Gg: AR+sD13iXBtjY3/2GWjoUGxdvF5B1WTqxtB90EDoHtW74JCyR0zsK7NndFFIy28fMQD e7lVbGBdJz7ZNJ4Ou29KRhl8b9lb5zpz6TfD1lMHIABNidXj9P77N5srE0WoqhiwrL/gWe3nATK Hba7+t0tWaCrN/XGCm8XteQm+BfOOvSpDBA5KSGZ5aS3iD2j1rfSxEjnErq36XYfEJD6l3LG116 d88SsD4oZnYM0P/eh6m9rKa3ffx6kmHLgDdEyk1FjnAculeKmRi4W/p15tZxCFT0cks6djPlVuM HLDwvcDeveAGf/d9J0Q4hP1VSsxwwxzLRe0E4JsXPaQonjY529RBMuWn2N1wwSUAT7vb8sg0Ey7 nQrqx5RoQn97G0FUU5oabSlKMDKWCgNck9w+LxnzqzWkfzbnmC4mKSac9wp8eeKRZczAnG0939L B0uT1Cd/qeUKZRNR0F/XVO/4UDuFd38n7D051RFeBFoUxYX2J/Yu7ybdc= X-Received: by 2002:a05:6a00:3cd2:b0:845:4d71:8d15 with SMTP id d2e1a72fcca58-84fb5594960mr1551942b3a.37.1786499183422; Tue, 11 Aug 2026 18:46:23 -0700 (PDT) Received: from fedora ([203.175.12.241]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84fb1d2b813sm388330b3a.22.2026.08.11.18.46.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 18:46:22 -0700 (PDT) Date: Wed, 12 Aug 2026 09:46:16 +0800 From: Hangbin Liu To: Xin Xie Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, fmaurer@redhat.com, luka.gejak@linux.dev, kexinsun@smail.nju.edu.cn, arvid.brodin@alten.se, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: hsr: free learned nodes on device setup failure Message-ID: References: <20260808110814.1637-1-xiexinet@gmail.com> <063eb98e-95d2-4d95-9720-08b351fb6e6e@gmail.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=us-ascii Content-Disposition: inline In-Reply-To: <063eb98e-95d2-4d95-9720-08b351fb6e6e@gmail.com> On Tue, Aug 11, 2026 at 03:56:08PM +0200, Xin Xie wrote: > On 10/08/2026 03:31, Hangbin Liu wrote: > > Should we use this fix tag? The proxy_node_db is added in > > 5055cccfc2d1 ("net: hsr: Provide RedBox support (HSR-SAN)"). > > > > Thanks > > Hangbin > > Thanks for checking. I believe 81ba6afd6e64 is the right tag. > > The demonstrated leak is node_db, and the window that creates it was > born in 81ba6afd6e64: that commit moved per-device RX handler > registration into hsr_dev_finalize(), ahead of steps that could still > fail (the second handler registration, self-node allocation, > register_netdevice()), while the failure unwind never released nodes > learned through the already-live handler. Before it, reception used > the module-global dev_add_pack() handler, which could not reach an > instance until register_hsr_master() at the successful end of > finalize, so there was nothing to leak. > > proxy_node_db cannot hold entries on any current finalize error > exit: it is fed only by interlink-port RX, and the interlink add is > the last failable step in finalize. On this path, the second > hsr_del_nodes() call is a harmless no-op on an empty list, keeping > the unwind symmetric with hsr_dellink(). > > Using 5055cccfc2d1 would instead keep the fix away from older stable > trees, where the node_db leak does exist. Yes, your explanation is reasonable. I just a little concern about the stable back port. Maybe add a tag like Cc: # 5055cccfc2d1 ("net: hsr: Provide RedBox support (HSR-SAN)") Let's wait and see other's opinion. Thanks Hangbin