PT-2026-167018
CVE-2026-143160
·
Publicado
2026-12-03
·
Atualizado
2026-12-03
Descrição por
Pontuação
N/A
Não disponívelNão há classificações de severidade ou métricas disponíveis. Quando houver, atualizaremos as informações correspondentes na página.
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.
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾