Article View: linux.kernel.netdev
Article #20757Re: [PATCH net-next 0/3] net/smc: fix clcsock lifetime vs asynchronous paths
From: Sidraya Jayagond
Date: Mon, 23 Nov 2026 06:38
Date: Mon, 23 Nov 2026 06:38
62 lines
15030 bytes
15030 bytes
On 20/11/26 6:15 pm, Mahanta Jambigi wrote: > The internal TCP socket (clcsock) of an SMC socket is freed by > asynchronous paths: link group termination reaches > smc_close_active_abort() and peer close reaches > smc_close_passive_work(), and both can run while the SMC socket is still > referenced by an open file descriptor. A task that uses the fd at that > moment, for example getsockopt() or a socket diag dump, then operates on > a released socket. > > Free the clcsock only when no socket file can reference it: from the > socket release paths, after the socket has been unhashed, and from the > abnormal close paths once the socket has no file left. The decision is > made under the socket lock, and the accept path holds the same lock > across the accept-queue state check and sock_graft(), so a connection > that is being accepted cannot lose its clcsock to an asynchronous close. > The clcsock_release_lock is no longer needed: a socket operation on a > file is serialized with smc_release() by the file reference, and the > listen work is covered by flush_work() and cancel_work_sync() in > smc_clcsock_release(). > > Trade-off: with an open file, a clcsock now stays allocated after an > abnormal close until the application closes the SMC fd. The SMC > connection is already torn down and its TCP connection has been reset or > shut down; only the local TCP socket remains allocated until then. > > Patch 1 makes the lifetime change and is self-contained. Patch 2 removes > the lock and the checks it made necessary, and serializes the accept > path with the asynchronous close. Patch 3 documents the invariant and > adds a destructor warning for it. The diag dump keeps its NULL check: a > socket is hashed in smc_sk_init(), before its clcsock is created. > > This is hardening found by code walk, not a fix for a reported > regression, so the series targets net-next and carries no Fixes: tag. > > Mahanta Jambigi (3): > net/smc: keep clcsock until socket release > net/smc: remove the clcsock release lock > net/smc: document the clcsock lifetime > > net/smc/af_smc.c | 123 +++++++++++++++--------------------------- > net/smc/smc.h | 8 ++- > net/smc/smc_close.c | 35 +++++++++---- > net/smc/smc_diag.c | 3 ++ > net/smc/smc_inet.c | 9 ++-- > 5 files changed, 82 insertions(+), 96 deletions(-) > This series does not apply on net-next here. The cover letter carries no base-commit: b4 am reports "Base: not specified", so it is not possible to tell which tree the series was generated against. Please repost with the base recorded, so that b4 am and reviewers apply against the exact commit,for example: git format-patch --base=origin/net-next -o outgoing/ which adds base-commit: <sha> to the cover letter. Naming the base SHA in the cover text is enough. Thanks, Sidraya
Technical Details
Message-ID:
<90fb64eb-8fd6-47de-8773-263701b2179c@linux.ibm.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369078-linux-kernel-netdev=dewy.ruReferences:
<20261120124534.430200-1-mjambigi@linux.ibm.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369078-linux-kernel-netdev=dewy.ru
From: sidraya@linux.ibm.com (Sidraya Jayagond)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 0/3] net/smc: fix clcsock lifetime vs
asynchronous paths
Date: Mon, 23 Nov 2026 12:08:40 +0530
Organization: Usenet Network
Message-ID: <90fb64eb-8fd6-47de-8773-263701b2179c@linux.ibm.com>
References: <20261120124534.430200-1-mjambigi@linux.ibm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="3809543"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:1FpaFRFw5lM1d8a8jFu/mVgLIRA= sha256:07I2S1EtkyILRBW9cnFZL4VkbQU8WG2CEW9QKRxKmzM=
sha1:UFvefjrV+LVIsAFH+cgE23mqXZs= sha256:D3Dwoqac/GUU7639DUl5k8Ef1gKqtigID3NVbMuTAoY=
Content-Language: en-US
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 6085A125D90; Mon, 23 Nov 2026 09:39:33 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
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=ibm.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 VwXo2QjGYLk7;
Mon, 23 Nov 2026 09:39:30 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369078-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=linux.ibm.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 1E3EA125D8F; Mon, 23 Nov 2026 09:39:22 +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 948C72D0C9; Mon, 23 Nov 2026 06:39:20 +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=1795415959;
b=0H+L7mYAXQoz8Hjni6x9knM9CFTuEiPfKFxMf2MX852xaUO8kNjj1iDlKvWwIW1jQgDZ
vzWisEdhop2NJlCRw266i2zwwLNMrR2G+/laJkrq/WCvp1yV04JlwwJdDAMTIQpKySCPs
fdbaNilKBMhqE+NBo40I2pCe+vcnRThATJKHSEM1/3BQGSDqrjROqsCHgzFvbgW8SOTEU
wURDeddkVvZQI/3CXtjYh4Wy8LBnuuvCP0IEJ/zzrqYE+UKMAeKBaaArtz8gyhp8cSX3o
Aiq3maxqNGxPNXRPyOfAFkqxIatnc4Y3QnKAtQdPRVPmn3M3fvAO1Zakphn40AcgQ/Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795415959;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:Received:
Received:Received:Received:Received:Received:Received:Message-ID:Date:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
Subject:To:Cc:References:Content-Language:From:In-Reply-To:
Content-Type:Content-Transfer-Encoding:X-TM-AS-GCONF:
X-Proofpoint-Reinject:X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Info:
X-Proofpoint-GUID:X-Authority-Analysis:X-Proofpoint-Spam-Details-Enc:
X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details;
bh=3p6j4BummQ7DEDYd3L0u+o/FJMfAWrrauAFxppvlCxs=;
b=YiVRJ8cKZLu71Q+Mzo6U+iVqO0F+l8uqHxMM9VgK0qKHR9oUGGIKQ8ngoncQZAfmH1X5
f496LsqsVbOdToe9pE1xrAImRhC5vQgOHvA10SfRoeo2RuJn66gmoDogSdnrGW02aKwzW
517jb6W7YX8193wh/MJSPb0f4LbAWlXsR8TuGJxW0eQYP0tWAbDNVE0q19WKbeG2XqDgJ
jT9wJ1EfapxY4j7SU7YA5Pr1BR7YHB8Bro7XhkyGMGnAKM/Mcgmr7D5nm+ISyDDT2at6Y
onX8D1hVxRyMFu1bis6Lfj/33jo7jv0hK4af6ACFL1B2d/9YiPSFumiZejjI1xK0qYA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=gcmlENnq;
dmarc=pass header.from=linux.ibm.com;
spf=pass smtp.mailfrom=linux.ibm.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 8800D606A32A;
Mon, 23 Nov 2026 06:39:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=gcmlENnq
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.163.158.5
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795415953;
b=rUdukB9JkQio/YvgXbsbvWyj23cCQoSk3cPN8DjNPJpamX3P2BDtWOaXVg277vHKrBvy
wo7oTLlxazzmodfe43xuUzZs7q4dSRXALD0gRYVQJBk+TlB2tBZDjkevMFOj9VSi5BJ+i
P3MAPvrScPPDpjt52XWcQE5NL2WoN78hf+5+JOlFhhjqpp344SWDjtjTOMn1UmYADABFu
hXseYEtYr4C94FZBVX+fsAO/hTik4/P0kXQrsTGRfwlwBzQsOsJQkZSqw4Q7KGY6NUeSU
8MsiOGLOF5+QzTk4iG4EkvIPe21e1D/pN9qHvSRPtIQYtzmYCpPJ4EsSFNERl4o1mpQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795415953;
h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Received:
Received:Received:Received:Received:Message-ID:Date:MIME-Version:
User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To:
Content-Type:Content-Transfer-Encoding:X-TM-AS-GCONF:
X-Proofpoint-Reinject:X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Info:
X-Proofpoint-GUID:X-Authority-Analysis:X-Proofpoint-Spam-Details-Enc:
X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details;
bh=3p6j4BummQ7DEDYd3L0u+o/FJMfAWrrauAFxppvlCxs=;
b=Xi5n35hoSjTjnVhQRg2OJNmF/LR0gQbm5y+Wr11cSp6QeFfvNP6vJiaKZrXQMrgBza1f
FioZ+s0TmDKPAUzSLid2pxL4f2c9R4G3bRDrvMbdfLELES3bAFSfSOuoPKqCkwahZZE/M
BrjnAUYg/E5c14xV70r6BVatvqWeQ8kFrY+to9gqb60Yr9XbC/tVouLpuFwDiF3wUVUOb
DbIqyscrvdy1gyBx614Oe2Xl6mQXgCaxSDBj0c/PNcmn6Hv83e7zukcT8nDhFlwbHfm8X
q1zKxdBPlsGcQejielDQxIezWuwwCg6TA9OtgwLNyhQfEbx6dzLiahnmje95BcHElPw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=linux.ibm.com;
spf=pass smtp.mailfrom=linux.ibm.com;
dkim=pass header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=gcmlENnq;
arc=none smtp.remote-ip=148.163.158.5
X-Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EA59606A31A;
Mon, 23 Nov 2026 06:39:12 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2EA59606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com
X-Received: from pps.filterd (m0360072.ppops.net [127.0.0.1])
by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AN556vg2634170;
Mon, 23 Nov 2026 06:38:50 GMT
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc
:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=pp1; bh=3p6j4B
ummQ7DEDYd3L0u+o/FJMfAWrrauAFxppvlCxs=; b=gcmlENnqM6MZy2/TO8vaqY
N5QSGCaIlBbQmO2dCASYvAex4SoCazeK6mwsEZbkd+jswWXNN2sg2zL/zk+4tH+o
6dXu2/8wrzMNelwT8n2uAhSeLuv/t6ZnGCx7vkwoc6oFIVJMRVhQ94hJYRSjBkCi
MMi7PJpwIA+ndg+oHgGU27DPd6GYcpkLgPKyCQCQ73WTM/6WQXb0175PLMAoiipC
yCZvxz74vDIdwRAg+ghnQc90wYickdQPTldmejkKujzv0tNmDVrqR5i3jabgF6iq
CdQ6+zNw3EXOn3nvtnQDqfXmOlufyrx3tgExgt7+ucBqaAr/dkscmWhpA98HYjdg
==
X-Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220])
by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4j34g11jv6-1
(version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
Mon, 23 Nov 2026 06:38:49 +0000 (GMT)
X-Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1])
by ppma12.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6AN54SlE1346513;
Mon, 23 Nov 2026 06:38:48 GMT
X-Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226])
by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4j3nmqdtn9-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Mon, 23 Nov 2026 06:38:48 +0000 (GMT)
X-Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103])
by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6AN6ciW645285684
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
Mon, 23 Nov 2026 06:38:44 GMT
X-Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1])
by IMSVA (Postfix) with ESMTP id 66E1A2004B;
Mon, 23 Nov 2026 06:38:44 +0000 (GMT)
X-Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1])
by IMSVA (Postfix) with ESMTP id AEC9120043;
Mon, 23 Nov 2026 06:38:41 +0000 (GMT)
X-Received: from [9.123.13.84] (unknown [9.123.13.84])
by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP;
Mon, 23 Nov 2026 06:38:41 +0000 (GMT)
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-User-Agent: Mozilla Thunderbird
X-Cc: hidayath@linux.ibm.com, pasic@linux.ibm.com, horms@kernel.org,
tonylu@linux.alibaba.com, guwen@linux.alibaba.com,
netdev@vger.kernel.org, linux-s390@vger.kernel.org,
linux-rdma@vger.kernel.org
X-In-Reply-To: <20261120124534.430200-1-mjambigi@linux.ibm.com>
X-TM-AS-GCONF: 00
X-Proofpoint-Reinject: loops=2 maxloops=12
X-Proofpoint-ORIG-GUID: _rBVRy8o8DAmjMQF4L8z2M8ImwNSrJd-
X-Proofpoint-Spam-Info: AW1haW4tMjYxMTIzMDAyNiBTYWx0ZWRfX8wuVjDiQOY8G
lW16sRYHwau+s+eOe2hfyHs385klPRws95jsc0V2oxy2pnLIsPxWIibanyPgQPI0ZSI6EMYoZTP
gNe/z5E7vwrsKNERlWUXXyFc3Cd2CMA=
X-Proofpoint-GUID: ZYuclnfSGq8afemKTGN9w3r1haX4RmPb
X-Authority-Analysis: v=2.4 cv=c8M+0h9l c=1 sm=1 tr=0 ts=6b03df79 cx=c_pps
a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17
a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22
a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=Upmd74fEsTyMv7FUjCUA:9
a=QEXdDO2ut3YA:10
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTIzMDAyNiBTYWx0ZWRfXz4h4F3OKm9pD
VJxL83zO54K7KDyBL3wYjMdZaf7fM8UEYwjLLG9sAHEaXYhK+GSbme7LtlkriE3iwo4VY6OcA9J
NRWPQXJs1HJwLSvLY8ZwrLBW9LO1QsJFxqMMVp7ohM/dzH6CmJz6Y+WEAIFxAscH06Q3Q7jdym9
oml5dyjSnvIh0os2ZyEwdVdpBk8s1BHZMESQB2K3B5D0NeRDUQUCQaTerol3jCvvE2MWW6uGeQ7
BWIIGdwSDBTTA4e/I7fjEj79jCe/x5IIq55RdyvihMu/+oRRvQJoX7fwJbREnpQtqSxtLfuN00e
aMdGRdoqXzQJYfVxotsCCRe48SvASIFf4Z2sOiX5q0tZXcv61T8oG9axwLcG4it/BLaQQlg5qjj
3AruepxN/5D++dQdxYSwkTHE2fCs1dkReIsGd9aKSyePVNx6OdT+Vtvf3VN+5hkERA0feE6Xtfu
n9p29lopn0DGdQoRKpQ==
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49
definitions=2026-11-23_01,2026-11-22_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
impostorscore=0 clxscore=1015 malwarescore=0 suspectscore=0 bulkscore=0
priorityscore=1501 phishscore=0 adultscore=0 spamscore=0 lowpriorityscore=0
classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611230026