{"id":"CVE-2026-143160","state":"PUBLISHED","title":"net/smc: fix lgr/lnk lifetime vs diag reader race","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/smc: fix lgr/lnk lifetime vs diag reader race\n\nThe diag dump walks the socket hash table under a read_lock and\ndereferences conn->lgr and conn->lnk. Several paths expose a window\nwhere a hashed socket has freed or partially freed conn/lgr/lnk state.\n\nFirst, smc_conn_abort() calls smc_conn_free() during early handshake\naborts while the socket is still hashed in SMC_INIT, synchronously\nfreeing the lgr on the smc_lgr_cleanup_early() path without holding the\nhash write_lock. A concurrent diag reader can load a non-NULL conn->lgr\nand dereference it after the kfree. Skip the connection, link group and\nDMB attributes in __smc_diag_dump() for sockets in SMC_INIT or\nSMC_CLOSED or fallen back to TCP, and take diag_mode from an is_smcd\nflag cached at connection creation.\n\nThe state filter alone does not close the race. A connection aborted by\na failed handshake can keep its alert token, because smc_conn_free()\nskips the unregister when smc_lgr_terminate_sched() has emptied\nlgr->list; close_work may also have been queued before the abort, as the\nCDC receive path is not excluded by the handshake's socket lock.\nsmc_close_passive_work() would then move the hashed socket from SMC_INIT\nto SMC_APPCLOSEWAIT1 or SMC_PROCESSABORT, states the filter does not\ncover, and later run a passive-closing sock_put() that\nsmc_connect_decline_fallback() dropped already. Return early from\nsmc_close_passive_work() when the connection was freed; the check holds\nthe socket lock that every smc_conn_free() caller holds as well, so a\nhashed socket with a freed connection stays in SMC_INIT or SMC_CLOSED\nuntil release.\n\nThis changes the sock_diag output for such sockets: the connection, link\ngroup and DMB attributes are omitted, which smcss does not read for\nsockets in these states, while SMC_DIAG_FALLBACK is still reported and\nan SMC-D socket in SMC_INIT or SMC_CLOSED still reports\nSMC_DIAG_MODE_SMCD from the cached flag. A fallback socket is a plain\nTCP socket with no SMC connection state to report; the stale conn fields\nleft behind by smc_conn_abort() must not be read.\n\nSecond, in smc_conn_kill() on SMC-D with dmb_nocopy, smcd_buf_detach()\nNULLs and frees conn->sndbuf_desc while the socket is still hashed. A\nconcurrent diag reader entering the CONNINFO block can dereference the\nfreed descriptor. Unhash the socket right before smcd_buf_detach(). As a\nresult, killed ACTIVE and APPCLOSEWAIT sockets that are still open are\nno longer visible to smcss on loopback-ism devices.\n\nThird, in the terminal teardown branches of smc_close_active_abort()\n(PEERCLOSEWAIT and PROCESSABORT groups) and in smc_close_passive_work(),\nsmc_conn_free() drops lgr and lnk references while the socket is still\nhashed. Unhash immediately before each smc_conn_free() call at those\nsites. Sockets killed in those close states are therefore unhashed, and\ntheir inuse accounting dropped, before close(), even if the fd is still\nopen.\n\nFourth, use smp_load_acquire() / smp_store_release() on sk_state to\norder these checks on weakly ordered CPUs. A reader that observes\nSMC_ACTIVE is guaranteed to see the connection setup that preceded the\nstore; a reader that observes SMC_CLOSED from smc_listen_out_err() skips\nthe connection fields in any case, so that particular store is hardening\nkept for uniformity, not a required ordering.\n\nAdditionally, in __smc_diag_dump(), use the cached link->ibname instead\nof link->smcibdev->ibdev->name, avoiding a NULL pointer dereference or\nuse-after-free of the IB device when __smcr_link_clear() zeroes the link\nduring concurrent SMC-R link failover. The link data is still read\nwithout conns_lock or send_lock, so a dump racing a failover may\ntransiently report zeroed or mixed link fields; this does not affect\nmemory safety and the next dump reports the new link. Like the SMC\nnetlink link dump and the tracepoints, the name is the one cached at\nlink creation time.","publishedAt":"2026-12-03T09:19:59.813Z","updatedAt":"2026-12-03T09:19:59.813Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f16a7dd5cf27eeda187425c9c7d96802a549f9c4","status":"affected","lessThan":"16d19661c3dc49c70d9941e29ee267328d2dbd27","versionType":"git"},{"version":"f16a7dd5cf27eeda187425c9c7d96802a549f9c4","status":"affected","lessThan":"f57659ad6fe30d130cb27a09e61f3ac9c80c99a4","versionType":"git"},{"version":"f16a7dd5cf27eeda187425c9c7d96802a549f9c4","status":"affected","lessThan":"3871bd1cc528b3f9c13eec6d7f8de4a33461c1af","versionType":"git"},{"version":"f16a7dd5cf27eeda187425c9c7d96802a549f9c4","status":"affected","lessThan":"d7900fa51642fbc2a5a03354238e71050a7d391d","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/smc/af_smc.c","net/smc/smc.h","net/smc/smc_close.c","net/smc/smc_core.c","net/smc/smc_diag.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.11","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/smc/af_smc.c","net/smc/smc.h","net/smc/smc_close.c","net/smc/smc_core.c","net/smc/smc_diag.c"]}],"references":["https://git.kernel.org/stable/c/16d19661c3dc49c70d9941e29ee267328d2dbd27","https://git.kernel.org/stable/c/f57659ad6fe30d130cb27a09e61f3ac9c80c99a4","https://git.kernel.org/stable/c/3871bd1cc528b3f9c13eec6d7f8de4a33461c1af","https://git.kernel.org/stable/c/d7900fa51642fbc2a5a03354238e71050a7d391d"],"weaknesses":[],"ingestedAt":"2026-12-03T09:40:06.136Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143160.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143160","state":"PUBLISHED","datePublished":"2026-12-03T09:19:59.813Z","dateUpdated":"2026-12-03T09:19:59.813Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.355Z"},"containers":{"cna":{"title":"net/smc: fix lgr/lnk lifetime vs diag reader race","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/smc: fix lgr/lnk lifetime vs diag reader race\n\nThe diag dump walks the socket hash table under a read_lock and\ndereferences conn->lgr and conn->lnk. Several paths expose a window\nwhere a hashed socket has freed or partially freed conn/lgr/lnk state.\n\nFirst, smc_conn_abort() calls smc_conn_free() during early handshake\naborts while the socket is still hashed in SMC_INIT, synchronously\nfreeing the lgr on the smc_lgr_cleanup_early() path without holding the\nhash write_lock. A concurrent diag reader can load a non-NULL conn->lgr\nand dereference it after the kfree. Skip the connection, link group and\nDMB attributes in __smc_diag_dump() for sockets in SMC_INIT or\nSMC_CLOSED or fallen back to TCP, and take diag_mode from an is_smcd\nflag cached at connection creation.\n\nThe state filter alone does not close the race. A connection aborted by\na failed handshake can keep its alert token, because smc_conn_free()\nskips the unregister when smc_lgr_terminate_sched() has emptied\nlgr->list; close_work may also have been queued before the abort, as the\nCDC receive path is not excluded by the handshake's socket lock.\nsmc_close_passive_work() would then move the hashed socket from SMC_INIT\nto SMC_APPCLOSEWAIT1 or SMC_PROCESSABORT, states the filter does not\ncover, and later run a passive-closing sock_put() that\nsmc_connect_decline_fallback() dropped already. Return early from\nsmc_close_passive_work() when the connection was freed; the check holds\nthe socket lock that every smc_conn_free() caller holds as well, so a\nhashed socket with a freed connection stays in SMC_INIT or SMC_CLOSED\nuntil release.\n\nThis changes the sock_diag output for such sockets: the connection, link\ngroup and DMB attributes are omitted, which smcss does not read for\nsockets in these states, while SMC_DIAG_FALLBACK is still reported and\nan SMC-D socket in SMC_INIT or SMC_CLOSED still reports\nSMC_DIAG_MODE_SMCD from the cached flag. A fallback socket is a plain\nTCP socket with no SMC connection state to report; the stale conn fields\nleft behind by smc_conn_abort() must not be read.\n\nSecond, in smc_conn_kill() on SMC-D with dmb_nocopy, smcd_buf_detach()\nNULLs and frees conn->sndbuf_desc while the socket is still hashed. A\nconcurrent diag reader entering the CONNINFO block can dereference the\nfreed descriptor. Unhash the socket right before smcd_buf_detach(). As a\nresult, killed ACTIVE and APPCLOSEWAIT sockets that are still open are\nno longer visible to smcss on loopback-ism devices.\n\nThird, in the terminal teardown branches of smc_close_active_abort()\n(PEERCLOSEWAIT and PROCESSABORT groups) and in smc_close_passive_work(),\nsmc_conn_free() drops lgr and lnk references while the socket is still\nhashed. Unhash immediately before each smc_conn_free() call at those\nsites. Sockets killed in those close states are therefore unhashed, and\ntheir inuse accounting dropped, before close(), even if the fd is still\nopen.\n\nFourth, use smp_load_acquire() / smp_store_release() on sk_state to\norder these checks on weakly ordered CPUs. A reader that observes\nSMC_ACTIVE is guaranteed to see the connection setup that preceded the\nstore; a reader that observes SMC_CLOSED from smc_listen_out_err() skips\nthe connection fields in any case, so that particular store is hardening\nkept for uniformity, not a required ordering.\n\nAdditionally, in __smc_diag_dump(), use the cached link->ibname instead\nof link->smcibdev->ibdev->name, avoiding a NULL pointer dereference or\nuse-after-free of the IB device when __smcr_link_clear() zeroes the link\nduring concurrent SMC-R link failover. The link data is still read\nwithout conns_lock or send_lock, so a dump racing a failover may\ntransiently report zeroed or mixed link fields; this does not affect\nmemory safety and the next dump reports the new link. Like the SMC\nnetlink link dump and the tracepoints, the name is the one cached at\nlink creation time."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f16a7dd5cf27eeda187425c9c7d96802a549f9c4","status":"affected","lessThan":"16d19661c3dc49c70d9941e29ee267328d2dbd27","versionType":"git"},{"version":"f16a7dd5cf27eeda187425c9c7d96802a549f9c4","status":"affected","lessThan":"f57659ad6fe30d130cb27a09e61f3ac9c80c99a4","versionType":"git"},{"version":"f16a7dd5cf27eeda187425c9c7d96802a549f9c4","status":"affected","lessThan":"3871bd1cc528b3f9c13eec6d7f8de4a33461c1af","versionType":"git"},{"version":"f16a7dd5cf27eeda187425c9c7d96802a549f9c4","status":"affected","lessThan":"d7900fa51642fbc2a5a03354238e71050a7d391d","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/smc/af_smc.c","net/smc/smc.h","net/smc/smc_close.c","net/smc/smc_core.c","net/smc/smc_diag.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.11","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/smc/af_smc.c","net/smc/smc.h","net/smc/smc_close.c","net/smc/smc_core.c","net/smc/smc_diag.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/16d19661c3dc49c70d9941e29ee267328d2dbd27"},{"url":"https://git.kernel.org/stable/c/f57659ad6fe30d130cb27a09e61f3ac9c80c99a4"},{"url":"https://git.kernel.org/stable/c/3871bd1cc528b3f9c13eec6d7f8de4a33461c1af"},{"url":"https://git.kernel.org/stable/c/d7900fa51642fbc2a5a03354238e71050a7d391d"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:19:59.813Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"7.4-rc3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}