From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy2-f41.google.com (mail-dy2-f41.google.com [74.125.229.41]) (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 431A62DB79F for ; Sat, 3 Oct 2026 18:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.229.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791052373; cv=none; b=cYnlE6airsw+QMi7o1oyS4MIHqAGI+WXvEVDijPf1EMkpP6KeHkSMPxR8U+tek14azrC+fcqWmeHdsobMs0xhy0mo7FV+uNBUBAsamm1sIwaLCtruELR3AyUyzfIB9J1Yoxvu25tmBVQpnpplW9uB2Cb7e93F31fY3efABJOuKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791052373; c=relaxed/simple; bh=4O9b2fhqkP+W3xXPcxSroMY1Stl9Hf0z/8z2N+sFacI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ETsxMRV3ymsOZiw/tzFLhQBTH+QQFOKklgkUxINPisSmfKFuFK6IE16Np5HOboe7NC2UmHU0SSoXWV2zigkm6Vpsj2fNevvKFzDUkradsQo95osu0MVWGq8F5pV8v4DCtr39ZzM126w8YCvVlu3CHDA8iDOOXmP5swR09Bd2sgc= 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=JwcM4DdX; arc=none smtp.client-ip=74.125.229.41 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="JwcM4DdX" Received: by mail-dy2-f41.google.com with SMTP id 5a478bee46e88-34c28125492so43328eec.2 for ; Sat, 03 Oct 2026 11:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791052369; x=1791657169; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=NjhFw2Ze94b8Op4Wrc9mSVlEKmb9LEFTwAUiX7feoLw=; b=JwcM4DdX/Lyry8WJG1nMvsKFJZpTghI5xUrcoNF0rp7DfJeHIUl6XRe62jTGwgrTL/ FhuvSlPospUK3tGyqISio+7pwGt8K51eiXiwdus5TixWBeZT4oJewImGCw4NXqaTT4s9 NiuNKg6wTQ9YOGC6iL4NXIEqbBCxseoHG4DeLTUoUlL7F3D/57iayNFObP9jS3sUuDrO YVOOj12qTRDyutpDhF6w4nyfyA8/GFjGveyDvsYOLOzOGDLp3yiLcnwIHDXF9kKixVvP 1V9sltluPd7gN61c0Yln9Ei/+LikpjaG//NUXX6vaUscV2z+WrfA1wKzb/67tFYWkmOx l7pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791052369; x=1791657169; h=content-transfer-encoding:mime-version: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=NjhFw2Ze94b8Op4Wrc9mSVlEKmb9LEFTwAUiX7feoLw=; b=xkiJPA1yq1fkATu55zkVHG5AxMg/pX2ZS/yfy0ajtDHI09ag+JouwDO3A/1MXKCswu Ucg0fh1wKkymy6DzrNQUHUw3KnHQPxGH2iJnAqY0+la+UWhJVbWYzTEmrVXF8G6RdBah yuvjxU9xvfuEsiO/v6JL3+65BbtoRMDEQKqJHCxgh11cfPmCZNdbkL3PFfhQ8p0HPqy2 BigqjtZteu1UVHrZ0AUBrlPN6W3az0f5zv2zfTE/ihUtiDqv1G/U7KRTAJznvprDvKUi i5Feg5F8lygl/X01ksUGpSDdUFFDm5BzzSCzJszD+ufmq16IORxwWoLvUBehFu11dp7r h+mA== X-Forwarded-Encrypted: i=1; AKwUvBxs49H1orlqXNhxrVjanndqLOFDPcff+G+BzEyfScTfI86FLolFJ4kjDH06QkX3lS/AmT7YwmHLBHvA@vger.kernel.org X-Gm-Message-State: AFq9FYIX2taRzKsrkvk1aHJOKjCreuDZLh8Z+Qoes+vP0BxYTt0fBAOP UBU3MHncAeIRtDf6W+yv5Ff6Sw0ieIU5/ia9oExiQGFHctlCosAtSzFd X-Gm-Gg: AYBFou0/x/wrxRItcGwemrZ4KcPhEGnUgi0h7TGkJWlqu6K0jnv9+tsQAW6UvaqAlcU ol6Ejb07XSBcGWJIah7ooYJkuCCdqCP3QAukzGB2kbVs6Gk+IBzD+chwWKij4hlBO4tTK7mRZrL +qOBNFjFTlTgfEGFdRxV79NyWI+ov6jSagXQa5Go6PcoPzP3ESWDmLfksXEFJaQo3leKuV0sGJX B4S8bfNxQn3DLv7rKbgcrhjZhqOwb4TvZCnU4cWxFYHf4Ci1Pck5QZ6wIY+JAC80wCoqGec5CWE Y9TS9bCEnZ83J+C9/2ggkdHz9gSZMlB3uG7hXzk41nqe3opJpKSVjrl35ClLu6Mf/lyFgr0Fl8l Z/J3l0JRZW6Rh3BDPiYNvYu6ZFrMymShrvhfR1N6XI5Iy0LqzcTcpklpeJGFSjJjq8CbC6flQhr OlnJVXnG+wj2vNuKoFT2l+pYwmMnjWzSTYTe8FdnAH1SBo3moN5236uYotiDvAh2ya3PNEaG+jA 3tYkDgWg0J80p+Y3smJeD4cFlHWmggf2OyOm6HEwE+yfjFCj7sTluzx1befCM3uozkwPw== X-Received: by 2002:a05:7300:24c9:b0:343:fdea:9a0 with SMTP id 5a478bee46e88-34f15028c8fmr12536988eec.2.1791052369159; Sat, 03 Oct 2026 11:32:49 -0700 (PDT) Received: from localhost.localdomain (95.169.12.199.16clouds.com. [95.169.12.199]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-34f14fd9698sm17118191eec.23.2026.10.03.11.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2026 11:32:48 -0700 (PDT) From: Chengfeng Ye To: alibuda@linux.alibaba.com, dust.li@linux.alibaba.com, sidraya@linux.ibm.com, mjambigi@linux.ibm.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com Cc: tonylu@linux.alibaba.com, guwen@linux.alibaba.com, horms@kernel.org, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH net v2 0/2] net/smc: fix link group teardown races Date: Sun, 4 Oct 2026 02:32:35 +0800 Message-ID: <20261003183237.2284245-1-nicoyip.dev@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-s390@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit These two fixes were posted separately, but both change the link group's freeing protocol. Resend them together so scheduling and early cleanup use the same locked teardown transition. Patch 1 serializes the freeing check and delayed-work rearm with teardown. It gives freeing its own storage and sets it under the list lock during early cleanup, so another connection cannot rearm after cancellation. It also corrects the cancellation comment: cancel_delayed_work() cancels pending work but does not synchronize with an already-running callback. Patch 2 excludes competing early teardown and pins both early-cleanup callers through their ownership checks, including failed registration of a new link group. Each patch retains its original KASAN evidence and Fixes tag. The evidence comes from earlier instrumented runs. The separate pre-existing race in which an already-running free_work callback outlives the group is outside this series. The callback reference and cancellation mechanisms are unchanged. The socket-lock versus abort-work wait cycle also remains separate. The series is based on net/main 71a77ab76e74. Local validation results are recorded alongside the exported patches; no runtime test is claimed. Chengfeng Ye (2): net/smc: serialize link group free work scheduling net/smc: serialize early link group cleanup with termination net/smc/af_smc.c | 8 ++++++-- net/smc/smc_core.c | 16 +++++++++++++++- net/smc/smc_core.h | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) base-commit: 71a77ab76e74131a101f4d2d2afb0dcbf81b4e3c -- 2.43.0