๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10728

Re: [PATCH net v5 2/2] net: restore refcount ordering for lockless socket access

#10728
From: Hyunwoo Kim
Date: Wed, 04 Nov 2026 01:24
35 lines
12791 bytes
On Tue, Nov 03, 2026 at 03:49:40PM +0100, Eric Dumazet wrote:
> Le jeu. 29 oct. 2026 ร  22:42, Hyunwoo Kim <imv4bel@gmail.com> a รฉcrit :
> >
> > Before commit fb041bb7c0a9 ("locking/refcount: Consolidate implementations
> > of refcount_t"), default builds implemented refcount_inc_not_zero() using
> > atomic_add_unless(), which provided full memory ordering on success. The
> > commit removed that ordering on weakly ordered architectures, allowing
> > accesses after a successful reference acquisition to be reordered before
> > it.
> >
> > Use refcount_inc_not_zero_acquire() in the IPv4 and IPv6 established
> > lookups and in inet_twsk_purge(), where the socket is validated again
> > after taking a reference.
> >
> > bpf_sk_assign() can receive a socket pointer obtained through BTF
> > without a reference. Use acquire ordering when it takes its own reference
> > for a refcounted socket.
> >
> > Use refcount_set_release() when setting refcounts in the SYN cookie,
> > TCP Fast Open, request migration, and TIME_WAIT paths. Keep the existing
> > TIME_WAIT smp_wmb(), which separately orders the refcount store before
> > ehash publication.
> >
> > Fixes: fb041bb7c0a9 ("locking/refcount: Consolidate implementations of refcount_t")
> > Fixes: 27e5203bd9c5 ("bpf: Change bpf_sk_assign to accept ARG_PTR_TO_BTF_ID_SOCK_COMMON")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
> > ---
> 
> Lack of links to prior versions is rather annoying.

Is the cover letter alone insufficient?

Should the changelog be in each patch?
Technical Details
Message-ID: <auqJOj7RVCWn7Ucl@v4bel>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356107-linux-kernel-netdev=dewy.ru
References: <20261029214219.1035176-1-imv4bel@gmail.com> <20261029214219.1035176-3-imv4bel@gmail.com> <CAL4WiioDoAT-50wStYDOy0b7f972QivB=Zk_7TCDrVPfOY665A@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356107-linux-kernel-netdev=dewy.ru
From: imv4bel@gmail.com (Hyunwoo Kim)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v5 2/2] net: restore refcount ordering for lockless
 socket access
Date: Wed, 4 Nov 2026 10:24:10 +0900
Organization: Usenet Network
Message-ID: <auqJOj7RVCWn7Ucl@v4bel>
References: <20261029214219.1035176-1-imv4bel@gmail.com>
 <20261029214219.1035176-3-imv4bel@gmail.com>
 <CAL4WiioDoAT-50wStYDOy0b7f972QivB=Zk_7TCDrVPfOY665A@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3300645"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:llA0h8TyvLzr2GONs8UwMqAepzE= sha256:eEZkMkdnZj7YzjK+9JUNFLqq52EOWc0eCFGX2sl/0P8=
	sha1:wMJAoXTy5ZPiR2lcJTlHAVm20EE= sha256:rwdQbri6lF+bAcaRLm3dONy0EhhGRGZOwWqqEA3J+XU=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 78C6F112A4E; Wed,  4 Nov 2026 04:28:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 0KF_4KCq5eUI;
	Wed,  4 Nov 2026 04:28:04 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-356107-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 14F341126ED; Wed,  4 Nov 2026 04:27:55 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 20BB027898; Wed,  4 Nov 2026 01:24:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793755458;
	b=jTubzsBlsP1THPuRoUq3bsO6Rb3xbf75VOaV/rXUgqkTysnWc6884qwGljYiRM63y+rK
	 92bQW7yFC67vxq9KCgG3YaR0eQfZarkg3fG6tMxOv1/rPN3kIZprYQRyqqaKtsgrgjSeM
	 ZJ3XQFkx6y8ScHQqlw5ySMBiiI+E58/pgdRRB7CVDL7TSpDaikBjMNEnzGF6D8bkXdIiL
	 vNHzghD6xm0KlORY73e3Pz1nyGNghtpJbyXWGamvnfm1mclgx5Eo/XGglS0jXcZunl8vN
	 rOKKx8rzm+ikJ7RdmA8F70TVFme9od3yMtonduTs7oaVTdoDRnPxzPHRY7auGHgpcfQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793755458;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:Date:From:To:Cc:Subject:Message-ID:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Disposition:Content-Transfer-Encoding:In-Reply-To;
	bh=XU8v5l3j1NJaqJxqv+9h3ZaBWo1SvrTb91gs/U4dLXE=;
	b=Denxxdh7kpQSNaZGRdo9m/a0eS3/3U/avDsJ5qz7Q4c4/gA4H6e11nB1IDQB4m5lJwgo
	 guQOsD9yQsSlHG00n1kEaxgN4pX6BRVwFZI7dy8dnvazRUfkKZBFXgwfLOTmYzIqdakA9
	 hZa+S0EH30Tf4tsPTAsAlgN0Mbs2o4qma/x/ICObzv/eYiR1wycQMf5HZLTjW/KstB3rM
	 XHoZ/poW35R/+8BUNuhBQqFNMs+UXrSekHGw38sa5ERr5sEsaViSmCYeaXpAtiAuwS7dP
	 QCFagzgMfcJNAyIhk9Nh5lfE6cyZDEcLhU/jTo6S9RW7B052aJ+g610wXCvZh1jh3KQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=waAzsuNI;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id ECF89606A330;
	Wed,  4 Nov 2026 01:24:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=waAzsuNI
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.172
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793755457;
	b=WQI2HBP5Df23ooWJ0NeucKpVlPUu0Ea8ll+tN7qaRgV6TbjUaBQE6cIeSOC7vYyntN96
	 NL6+CqKiFYdHHsAd2ctt/tvEo2/eGWcVRny9JCtjb1W65/XJ/SnRAneQc33MZz2NtU8gK
	 Y0ANSjEPyST5O3hXc1Y2mBdBHe1m+5vnLRUcEA/pUCPb1Vjm4yDhL6bgNZHfAeZoX10f/
	 0biX4U6609ebw4TB6Qa+/ySvlBywq/LaOJ5bjZVeAAqUyf0F4EJHtgq/NjXpiEkZqNqf4
	 Sxpic+LOW5ltXMBZYzH40EaqSmblwujaeOiHEMILjIKEcJVLJXy+t6lN1mJJMyurTzw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793755457;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:Content-Transfer-Encoding:
	 In-Reply-To;
	bh=XU8v5l3j1NJaqJxqv+9h3ZaBWo1SvrTb91gs/U4dLXE=;
	b=TtYi9jlKaWocAu4zfjsRFM7tmoSAAtwYXrSQ0Lu/0PGNL+wtgkYDftSQXLldhnsG8S5g
	 tXEMrzwH/byNiu52ebsDAtRJh9Hom1ysN18tB+MTjG8lpt110Vks9xFsLwkv6NfesulPJ
	 jvbvQ+PmTLuyQxII9xfK4jmTNe1+wE6fDkzxzabI40X7Y0P2fXt2ozAg/e1Nb+b/1Gwpl
	 aSbrU8g257xN8ureSd0fSgADxID3KrPpWlbx+Qf7kNsofVTnVictppAh7vJQK8WHLR+ae
	 UKzHEF1vRJb/viGOAa2dGuA307WUqfEy66PAY3oN6/Wa5yvU8HG9eW2vGQCiNfs9P3A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=waAzsuNI;
	arc=none smtp.remote-ip=74.125.82.172
X-Received: from mail-dy1-f172.google.com (mail-dy1-f172.google.com [74.125.82.172])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id C108B606A31B
	for <netdev@vger.kernel.org>; Wed,  4 Nov 2026 01:24:16 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C108B606A31B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy1-f172.google.com with SMTP id 5a478bee46e88-36cedf1bd63so45523eec.1
        for <netdev@vger.kernel.org>; Tue, 03 Nov 2026 17:24:16 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1793755456; x=1794360256; darn=vger.kernel.org;
        h=in-reply-to:content-transfer-encoding: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=XU8v5l3j1NJaqJxqv+9h3ZaBWo1SvrTb91gs/U4dLXE=;
        b=waAzsuNIow2jqOdqdB7euB21RrbldHH85o2R1JoeadLJjWkhIdBgr2T3S0zCyYh4q9
         a+WKgiuJavwofUwI0WvHi9B+q8oLHpL1XmYsJFxXUrwbKC2emI46itAKD5wma1Rf+rbQ
         dYNjrUvjb8y4UIdUuxn3q8B4cfoNAnonCAZgPG7FJ8Bk26biQcSKNQ7lQt9V1JoyZpNU
         +OJHQYhnh0ORNvGca7doJCPdddBk9WZqdEYyvgF5rXHU/MAuJaBDUi6lTczXlek/bxHO
         AS3LboUF73MSBysnsrrSkZ6FjSvCevLi8ODTOuAwTh3lyNAJqegbzBCFv/aE81Y3Zau9
         vgDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793755456; x=1794360256;
        h=in-reply-to:content-transfer-encoding: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=XU8v5l3j1NJaqJxqv+9h3ZaBWo1SvrTb91gs/U4dLXE=;
        b=TwjksYxWs1GnV8MFc0eb77mXAnAQo3zbAd4ixmw8JsMTx/jzMDEVyrvmGlf7IcTPQl
         GsNq0M2c4vfPrGFexQm/YrK5yZZr6oF2arxtr4sVl9Q+ZR7ZNeJ3ks6BBMm5SFYMMcbZ
         +Q3DjLoMkq35YDij7mmC8RpSxvAa9UU4a2Oz3NjlFHlHcfze/HJJGDDUhjggBMG+PxJq
         qxTGzqExZGd42ztC0AoL/g0MOLaPB7uGsN9ATBO9b2cikXClLM0ZR0vDYhJQJbOAsnLb
         +llApEB9+clB1cuihYo87rMQQRcBTHDX40AxiJTGwbM8M1GhgtRcO1dghKBK0ecsdnE1
         y8RA==
X-Forwarded-Encrypted: i=1; AKwUvBwqn/YnNj3Un+3Oup7k6j4mKW16Xk+XCdYCfHtyWeZ16+XAzyrrzEGmukYw9cHKPTth6udhkSM=@vger.kernel.org
X-Gm-Message-State: APuU4Z/5DjKrVPT0HXoazR4E4kkYs3CvBaJBL0HM+r92TVPk1hC7wJnH
	RHb2WAeu/wbdQRdMFQPMGN/PjkDPxjGPWE/Vh5Np6Mt5qsaESbMG/nhg
X-Gm-Gg: AYBFou20ME3nU/vV0hVorMIXvA++eY+aY/4JllPNlwhHZdYsjFblE08JhFz4ABzNuuo
	Chv16o2uhx060CzXouyjzsXg6uych3pZa5QnAZwYzYDHVx65viF8Mn5pjcnZXilEgebWErXFVCr
	8m3XsFp7be9Uf7HkPKhcr3KrNBq5Oln0U5Uo8WN5hMNgWYHf+tHXF9TllKtCiDY9YvvRkcsz0Jz
	WZr7e4oqhoSo6DefRkbJLj5B016ruSfk3jPP2GCQpPGgnpcn+jDfYc0jUoS5q4GuJH4I1qzGaXa
	sjetoxLvc2eVTyhszlIwVwGbdkwiza25NQMKGrjyvYOdNARgmeTQc0UfFG91jxuaE+yh/N4tEXD
	TFBGHkl4bMcj/t3QqDaGl9xRYtgqCGq6bxpURqT8BHebOjlfhzjIdnZ1+wCKJqShz9e15Y4eDSn
	qAwWRDN6wHYL4BpQRoSmhUTu4S5BrjJ7ivD4gpI2d+eaboWqtfqbucQX1lthHT6PnEXdkzGz6oL
	XhxIvZQs/9frdVauLdKpqJejhD45gm/s56wc0RatNOGyYko0ZbqC42EIQsSPoQjfbHqVXJFhx5a
	ilycnilAcBw5OmyH5Ivx0dGzIiaioSwnK2meQ53m7XQUSDU=
X-Received: by 2002:a05:693c:41ce:20b0:359:27e6:b684 with SMTP id 5a478bee46e88-36a2fd486a2mr25765748eec.3.1793755455764;
        Tue, 03 Nov 2026 17:24:15 -0800 (PST)
X-Received: from v4bel ([58.123.110.97])
        by smtp.gmail.com with ESMTPSA id 5a478bee46e88-36ca38a54ccsm2373254eec.4.2026.11.03.17.24.12
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 03 Nov 2026 17:24:14 -0800 (PST)
X-Cc: ncardwell@google.com, kuniyu@google.com, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	martin.lau@linux.dev, john.fastabend@gmail.com, weiwan@google.com,
	sd@queasysnail.net, jiayuan.chen@linux.dev, netdev@vger.kernel.org,
	stable@vger.kernel.org, imv4bel@gmail.com
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <CAL4WiioDoAT-50wStYDOy0b7f972QivB=Zk_7TCDrVPfOY665A@mail.gmail.com>