From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.170 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796570256; b=HLp5WVNEyNp9MMQbwkLR/Bq/WRE0sNfl+kaVNNi+MbVv2xHyF5Du9V6Zw8sBoCRX2HqZ iD2mboJpUu+kjcqEdh8KyfWTZz93havVShkRjQpGaridA/K3ToJwDoiuaRsTnriCsyN5W Gpktq1SzodM6hFgGIza4QdPzo6468wc3hxeRo5c0jKDuW/QHuUyRMJOVpU1kikUeF5z8Y ObvZYWdYGBYl+f1x6EomQdymGtM+2SoRE/2gcyRpd3fZZuqezWtYQx3wpsIHEfONStyNC FXZwrlDfgeCD7/40dq4ZuOjh9pSEvShp+Q4OFhVR7PuWslszgfcqsj23kFjLojPiI0A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796570256; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:Content-Transfer-Encoding:MIME-Version; bh=w3HJ33G+FoWiHPoNE0ddp/dvFs0fFIL/GMhLi73medQ=; b=UgisfjSAAIexs54ZKLDSLO51XWjjsbHvgy2izrDNoG35Mb22MQ4aS7+J04E7LOGdgDo3 R62x/v5F+LEK9VYAZ7qNEZ1G6GZddPnRdiWByHbj7D13vk2Tf5tgHKNgW9A0hAqH7lsOS ll6mfvR9/jDJpGviGxuxT/tp3XMzjfyGixKJyiXu3nbeREgc/ZsFLtPgCq0CDDMpD3mBe WxqLZeOMcIoEakHG5d+DXaJOAYocOpKU3L1CdubvT9+JlFylMQumJD0NsiIR0PVfXjVlS aaxbhwFlWyRwXjAQlmymsGopbqYE59EF4nqan8a0ySzn6LkozVmt1yvqRdHzid+xw0g== 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=i7UhWq7l; arc=none smtp.remote-ip=209.85.210.170 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 4B669606A322 for ; Sun, 6 Dec 2026 15:17:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4B669606A322 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.a=rsa-sha256 header.s=20260707 header.b=i7UhWq7l Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-8b2382bf051so1213777b3a.3 for ; Sun, 06 Dec 2026 07:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796570256; x=1797175056; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=w3HJ33G+FoWiHPoNE0ddp/dvFs0fFIL/GMhLi73medQ=; b=i7UhWq7luaeKAXVQt23rakqHhD44Wf5NgIU1DMaKANwu2aVhCByDeXXCijmQ2sO8Y5 RWjW3wholuV8Hjh2sDvUzicK5pDCUTAtUSUDaY8nLUbGB/NUBSFxFBD0tv1k9Of+bOfo w4yW33vyvS1SHdxXeoavkLM4c45U/2OTK53NXVBjhozzoumFY7kyKPDY0ycrLfScDt1S 9LgGe8a/S37tgIuswGPddolyjrB/H6+GKtX1vKxGTE4mkLvscHLbdXTlzy1q9a/9ScdV WJaI28S1J5hXBdruV6dNcrcsj0lQVJObMwVeS82pAJ3hAzUW4pLpyVyiDQIkIyTOqSJB SRxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796570256; x=1797175056; h=mime-version:content-transfer-encoding:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=w3HJ33G+FoWiHPoNE0ddp/dvFs0fFIL/GMhLi73medQ=; b=OS/PFIihs7yJj1pEAd1OoZJpztlSDRpaxt8qNhOCPhjLQ8OHOUrGd53FObxn25KjnQ EqNc2gXKwnaATZm6pAi4zHKgOZto+G18ZiKF8lm8J76GomYZGrvVoJWIIRvbzrcmlaBX Jpmb+o+ZDcGwo05G/UugAXMGm853Rl9v6wuMqXOfUqHNPMWwevr4VFNR1QLEFwdkIqPN YVD0J4mCXV/auIpmuE12qXUmeh26vsXbc56DNKbrFubF/MDaiUnDYg1CANWgIKPjwxEK 8eUKPuV5WeLhsy+fNGd0yktBIluF482aG3hnXDlpt2BtQuZCymUOj3m0LDD8m15SgwaE U7Fg== X-Forwarded-Encrypted: i=1; AL+hErHAQzdGJhRRapoIIV8AwZqAlzjdzKmHOSQPfMhiUXRkwmiaNjeJ7RG6g+RA+1x/HLSig+x2yGw=@vger.kernel.org X-Gm-Message-State: AB4q+uG5+9sXR7FN53++BJ1tNuOgOEPH0xg0oh2wI8hfbM3J+37G00kX sOCGgvDsnhgkh/LVWwX3qW8s4ofxjOrJM4gII4oExe/fHgyTIFjtkG15 X-Gm-Gg: AZFdTZfC8nVrWuojG28bZ5O1kjXvVrrWgI94Ono3gaU+DP/jHKyuh7FLrzh0ffGrZE0 s52PfMeCwecfG0CioJz9c8YhWHeopaasNTbWqxJawB2jRGIgG8lKTCZAis+ifE1HkSmfE82OH8d PymPvhaIOuBXNqfZe58xNWdsIHdQoP1HhYnQ9Yjk7AR4s4+1CWEbOPe+N078xIJG49gXRvTA4Co fQ4XOkfDmY09TSEz4+sqcHtYimDu+FPtFavXBmJKdrs6d7NkreJqbIjmYoRPhgPYhlfauFY+Uwk IU06o4ckFpV9frxNYS3TxDV1jJVZfV8O2nRp+kpLyZ0u11yj/+16ROLTDi9tw86Szvw4iTMxxLc 9uA2jSDMO8XQVVnGhcjlQkF38cumhn7XsiJTsyVm9aqWnRkJsPWD10Yy/kg8sS9b6hYtTfbZrp6 3Q6mevVE5oSxUI2MVKK8Be9xoGgC/+rgwSlvcnS5Pte+wYKezFq1Wk17VJgqnY9vrVMaLLjVBaA zoRBLsR8UO/3bP7X53oLxqflBUU0QDBU/+dMyB7mhu8SYYp4KiBo8tMj4nv8qqv8FAzEZj1wA5J kkU5idWTc3PJ2hjRBg== X-Received: by 2002:a17:90b:3912:b0:3b0:a3eb:75a0 with SMTP id 98e67ed59e1d1-3b5e05d670amr7109011a91.23.1796570255623; Sun, 06 Dec 2026 07:17:35 -0800 (PST) Received: from CanCanNeed-2.local ([2001:df6:11c0:e720::1]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d10dadsm18248302a91.5.2026.12.06.07.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2026 07:17:34 -0800 (PST) From: Qican Ma To: mjambigi@linux.ibm.com Cc: alibuda@linux.alibaba.com, dust.li@linux.alibaba.com, sidraya@linux.ibm.com, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, willemb@google.com, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net v4] net/smc: serialize clcsock release against CDC receive path Date: Sun, 06 Dec 2026 23:17:26 +0800 Message-ID: <179657024601.87770.10289400123103256144@gmail.com> In-Reply-To: <16726245-1c75-4efa-b259-7d528ff58713@linux.ibm.com> References: <179635082914.26472.6075133370101625319@gmail.com> <16726245-1c75-4efa-b259-7d528ff58713@linux.ibm.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Hi Mahanta, Thanks - v5 is out. You are right about the corking overclaim: smc_tx_should_cork() also requires sndbuf_space, and the copy happens before the cork check, so returning true there does not prevent RDMA writes. v5 rewords the commit message to state plainly that the guard only avoids the clcsock dereference on a dying connection; transmit activity remains governed by the existing EPIPE and conn->killed checks. I kept the guard as cheap defense-in-depth rather than adding an early error return, since sashiko's review raised a fair question about whether the cork path is even reachable in practice and I did not want to expand the behavioral surface on that uncertainty. Happy to drop it or upgrade it to an early check if you prefer either. v5 also addresses a regression risk the sashiko review found in the reorder itself: the cancel_work_sync(&conn->abort_work) inside smc_conn_free() previously ran after the lock-drop window around the clcsock release, which gave a lock-starved abort_work a chance to finish first. With the reorder that escape is gone, so v5 cancels abort_work with the lock dropped in __smc_release() before calling smc_conn_free(), mirroring smc_close_cancel_work(), and compensates the scheduler's sock_hold() when the work is dequeued before running (both there and in smc_conn_free()'s own cancel path, which had the same leak). The remaining callers share the pre-existing deadlock pattern either way; I left a note in the commit message that it deserves its own fix. Thanks, Qican Ma