CVE-2026-139237: ibmveth: release the pool kobjects when probe fails
In the Linux kernel, the following vulnerability has been resolved:
ibmveth: release the pool kobjects when probe fails
If registernetdev() fails in ibmvethprobe(), for example with -EINTR when the binding task is killed, probe frees the netdev but leaves the pool%d kobjects embedded in it registered in sysfs. Reading /sys/devices/vio/<unit>/pool0/num is then a use-after-free, and the next probe cannot add pool0.
Put the kobjects before freeing the netdev, as ibmvethremove() does, on this path and on the netifsetrealnumtxqueues() one.
The kobjects also have no release(). With CONFIGDEBUGKOBJECTRELEASE, kobjectput() defers their cleanup, including removing the sysfs files, to a work item, so freenetdev() can free them first, here and in remove(). Add a release() that signals a per-pool completion, and wait for it in both places before freenetdev(). Without that config, release() runs from kobjectput() and the wait returns at once.
Found in review of the ibmveth multi-queue RX series and confirmed by code inspection; the release() part was raised by the Sashiko review of the first version. Tested on a POWER10 LPAR with registernetdev() forced to fail with -EINTR by a test-only module parameter (not part of this patch): no pool%d directories remain and the device binds again. No kernel selftests cover ibmveth.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the ibmveth driver are affected when its probe path encounters an error after pool kobjects have been registered. The issue leaves pool sysfs objects associated with a netdev that has been freed.
What condition is needed to trigger the use-after-free?
The ibmveth probe must fail at register_netdev(), such as when it returns -EINTR because the binding task is killed. The described cleanup issue also applies to the netif_set_real_num_tx_queues() failure path.
How could an administrator recognize that the failure occurred?
A read of /sys/devices/vio/<unit>/pool0/num after the failed probe can access freed memory. A subsequent probe may also fail to add pool0 because the prior sysfs kobject remained registered.
Does CONFIG_DEBUG_KOBJECT_RELEASE change the behavior?
With CONFIG_DEBUG_KOBJECT_RELEASE enabled, kobject cleanup, including removal of sysfs files, is deferred to a work item. This makes it necessary to wait for each pool kobject's release before freeing the netdev; without that configuration, release occurs during kobject_put().