CVE-2026-89636 PUBLISHED

smb: client: clear ce->tgthint in free_tgts()

Assigner: Linux
Reserved: 11.09.2026 Published: 11.09.2026 Updated: 13.09.2026

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

smb: client: clear ce->tgthint in free_tgts()

When free_tgts() frees all structures in ce->tlist, ce->tgthint is left pointing to one of the freed cache_dfs_tgt structures.

If ce->tgthint is not reset before it is used later, it results in a use-after-free.

Set ce->tgthint to NULL in free_tgts() after the elements are freed to reflect that no elements remain.

Metrics

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 9.8

AV:N - The dangling ce->tgthint is created while handling FSCTL_DFS_GET_REFERRALS/TRANS2_GET_DFS_REFERRAL replies from a remote SMB server over TCP/445 (smb2_get_dfs_refer → cache_refresh_path → update_cache_entry_locked → free_tgts). A malicious, compromised, or MITM'd DFS server reaches this purely over the network. AC:L - A hostile DFS server controls referral TTL (down to CACHE_MIN_TTL), target lists, and TCP resets that drive dfs_cache_refresh and reconnect into update_cache_entry_locked; after free_tgts() the later get_tgt_name()/dfs_cache_noreq_update_tgthint() use is deterministic, and the attacker can size and retry referrals to leave the stale hint and reclaim the slab. PR:N - The attacker is the remote SMB/DFS peer (or a MITM on an unsigned session) and needs no account, capability, or local privileges on the victim; the client authenticates to that server, and the kernel DFS cache parses the reply regardless of which local user owns the mount. UI:N - Once a DFS CIFS mount exists (fstab, autofs/systemd automount, enterprise DFS, cifsroot), dfs_cache_refresh delayed work and reconnect-driven cifs_tree_connect()/dfs_cache_noreq_find() use the stale tgthint automatically after a server-induced refresh or TCP drop, with no further user action. S:U - The use-after-free is of kmalloc'd cache_dfs_tgt objects in the client kernel heap and remains in the same host kernel security authority; it does not cross a VM, IOMMU, or sandbox boundary. C:H - get_tgt_name() and dfs_cache_noreq_update_tgthint() dereference the freed cache_dfs_tgt (t->name). Reclaiming that slab with attacker-controlled SMB allocations yields an arbitrary kernel read via kstrdup/strcasecmp of a sprayed name pointer. I:H - Use-after-free of the heap cache_dfs_tgt enables heap spraying and overlapping live objects; the dangling hint is also copied into DFS referral state and used for failover tree-connect, giving a write/control-flow primitive once the object is reclaimed. A:H - Dereferencing the freed cache_dfs_tgt from reconnect (cifs_tree_connect → dfs_cache_noreq_find) or dfs_cache_find oopses or panics the client kernel, and a malicious server can retrigger it on every refresh or reconnect.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 54be1f6c1c37498bba557049df646cc239fa37e3 to 7507bd1885643d0461a6017767492450af1ce2a3 (excl.)
  • affected from 54be1f6c1c37498bba557049df646cc239fa37e3 to 9ab46a13798a61d9d020b01d4e57efdabe6624fa (excl.)
  • affected from 54be1f6c1c37498bba557049df646cc239fa37e3 to 5baab40404a9393bcc0b7b8f1950bf2c307e0984 (excl.)
  • affected from 54be1f6c1c37498bba557049df646cc239fa37e3 to b1b741cf8e7ce1b91d937e23decd3d3358748700 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 5.0 is affected
  • unaffected from 0 to 5.0 (excl.)
  • unaffected from 6.12.109 to 6.12.* (incl.)
  • unaffected from 6.18.50 to 6.18.* (incl.)
  • unaffected from 7.2.4 to 7.2.* (incl.)
  • unaffected from 7.3-rc1 to * (incl.)

References