UBUNTU-CVE-2026-98173: Use After Free
In the Linux kernel, the following vulnerability has been resolved: smb: client: fix use-after-free of iface in cifstryaddingchannels() cifstryaddingchannels() iterates ses->ifacelist with listforeachentrysafefrom(), which captures the next entry (niface) under ifacelock. The loop body then drops ifacelock for the whole duration of cifssesaddchannel(). A concurrent interface refresh (SMB3requestinterfaces() -> parseserverinterfaces()) marks all ifaces inactive and removes and frees any that are not re-advertised via listdel() + krefput(), where releaseiface() is a bare kfree(). Since niface typically has no channel holding a reference, the list reference is its last and it can be freed inside the unlocked window. On continue, the iterator advance step then dereferences niface->ifacehead.next, and the loop body reads iface->rdmacapable/isactive, both on freed memory. Fix this by never keeping an unreferenced list pointer across the unlocked window. Each channel attempt now re-scans the list from the head under ifacelock, takes a kref on the selected candidate, and passes only that referenced candidate to cifssesaddchannel(). weightfulfilled still tracks selection progress, so restarting the scan preserves the original weighted distribution and the weightfulfilled-before-krefput ordering on the failure path. Add a per-pass attempts cap so a flapping interface refresh cannot keep the inner loop spinning within a single tries increment.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Compensating control
In cifs_try_adding_channels(), add a per-pass attempts cap and, for each channel attempt, re-scan ses->iface_list from the head under iface_lock, take a kref on the selected candidate, and pass only that referenced candidate to cifs_ses_add_channel(); do not retain an unreferenced list pointer across the unlocked window.
Event History
Frequently Asked Questions
Which systems are exposed to this race condition?
Systems running one of the listed Ubuntu kernel packages are relevant when the SMB client is attempting to add channels while SMB server interface information is refreshed concurrently. The affected code is in the SMB client path, not a general interface-management path.
What conditions are required for the use-after-free to occur?
A channel-add attempt must drop iface_lock while a concurrent SMB3 interface refresh marks interfaces inactive and removes an interface that was not re-advertised. The channel-add iterator can then resume using a list pointer to the freed interface.
What does the resolved fix change?
The fix stops retaining an unreferenced interface-list pointer while the lock is released. It rescans the list under iface_lock for each channel attempt and takes a reference on the selected interface before passing it to cifs_ses_add_channel().