# CVE-2026-143160

- Bağlantı: https://www.allsafe.com.tr/cve-2026-143160/
- Yayımlanma: 2026-12-03T13:17:51+03:00
- Yazar: Postmaster

In the Linux kernel, the following vulnerability has been resolved:

net/smc: fix lgr/lnk lifetime vs diag reader race

The diag dump walks the socket hash table under a read_lock and
 dereferences conn-
>lgr and conn->lnk. Several paths expose a window where a hashed socket has freed
or partially freed conn/lgr/lnk state.

First, smc_conn_abort() calls smc_conn_free() during early handshake
 aborts while
the socket is still hashed in SMC_INIT, synchronously freeing the lgr on the smc_lgr_cleanup_early()
path without holding the hash write_lock. A concurrent diag reader can load a non-
NULL conn->lgr and dereference it after the kfree. Skip the connection, link group
and DMB attributes in __smc_diag_dump() for sockets in SMC_INIT or SMC_CLOSED or
fallen back to TCP, and take diag_mode from an is_smcd flag cached at connection
creation.

The state filter alone does not close the race. A connection aborted by
 a failed
handshake can keep its alert token, because smc_conn_free() skips the unregister
when smc_lgr_terminate_sched() has emptied lgr->list; close_work may also have been
queued before the abort, as the CDC receive path is not excluded by the handshake's
socket lock. smc_close_passive_work() would then move the hashed socket from SMC_INIT
to SMC_APPCLOSEWAIT1 or SMC_PROCESSABORT, states the filter does not cover, and 
later run a passive-closing sock_put() that smc_connect_decline_fallback() dropped
already. Return early from smc_close_passive_work() when the connection was freed;
the check holds the socket lock that every smc_conn_free() caller holds as well,
so a hashed socket with a freed connection stays in SMC_INIT or SMC_CLOSED until
release.

This changes the sock_diag output for such sockets: the connection, link
 group 
and DMB attributes are omitted, which smcss does not read for sockets in these states,
while SMC_DIAG_FALLBACK is still reported and an SMC-D socket in SMC_INIT or SMC_CLOSED
still reports SMC_DIAG_MODE_SMCD from the cached flag. A fallback socket is a plain
TCP socket with no SMC connection state to report; the stale conn fields left behind
by smc_conn_abort() must not be read.

Second, in smc_conn_kill() on SMC-D with dmb_nocopy, smcd_buf_detach()
 NULLs and
frees conn->sndbuf_desc while the socket is still hashed. A concurrent diag reader
entering the CONNINFO block can dereference the freed descriptor. Unhash the socket
right before smcd_buf_detach(). As a result, killed ACTIVE and APPCLOSEWAIT sockets
that are still open are no longer visible to smcss on loopback-ism devices.

Third, in the terminal teardown branches of smc_close_active_abort()
 (PEERCLOSEWAIT
and PROCESSABORT groups) and in smc_close_passive_work(), smc_conn_free() drops 
lgr and lnk references while the socket is still hashed. Unhash immediately before
each smc_conn_free() call at those sites. Sockets killed in those close states are
therefore unhashed, and their inuse accounting dropped, before close(), even if 
the fd is still open.

Fourth, use smp_load_acquire() / smp_store_release() on sk_state to
 order these
checks on weakly ordered CPUs. A reader that observes SMC_ACTIVE is guaranteed to
see the connection setup that preceded the store; a reader that observes SMC_CLOSED
from smc_listen_out_err() skips the connection fields in any case, so that particular
store is hardening kept for uniformity, not a required ordering.

Additionally, in __smc_diag_dump(), use the cached link->ibname instead
 of link-
>smcibdev->ibdev->name, avoiding a NULL pointer dereference or use-after-free of
the IB device when __smcr_link_clear() zeroes the link during concurrent SMC-R link
failover. The link data is still read without conns_lock or send_lock, so a dump
racing a failover may transiently report zeroed or mixed link fields; this does 
not affect memory safety and the next dump reports the new link. Like the SMC netlink
link dump and the tracepoints, the name is the one cached at link creation time.

Bu kayıt NIST NVD kaynağından aktarılmıştır. Etkilenen sürümler, güncel değerlendirme
ve üretici referansları için kaynak kaydı inceleyin.

Kaynak: [NIST NVD — özgün kaydı inceleyin ↗](https://nvd.nist.gov/vuln/detail/CVE-2026-143160)
