CVE-2026-139076: drm/nouveau/svm: drain fault handler before freeing svmm
In the Linux kernel, the following vulnerability has been resolved:
drm/nouveau/svm: drain fault handler before freeing svmm
The SVM fault handler nouveausvmfault() looks up each fault's nouveausvmm under svm->mutex, caches it in the fault array, then drops svm->mutex and dereferences the svmm across blocking faults (mmuintervalnotifierinsert(), hmmrangefault()).
nouveausvmm is not refcounted. On DRM file close nouveausvmmfini() -> mmunotifierput() frees it asynchronously via callsrcu() without waiting for the handler, and mmgetnotzero() pins the mm, not the svmm. flushwork() on the fault buffer otherwise runs only at device removal and suspend, never on close, so a fault handled concurrently with a close can dereference a freed svmm.
The instance is already unlinked by nouveausvmmpart() earlier in the same close, so no new fault can resolve to it. Drain the handler in nouveausvmmfini() before the free, guarding the flush with a NULL check on drm->svm: on device teardown nouveausvmfini() runs first and frees drm->svm (NULL) after blocking the notify and flushing the buffer, so the handler is already drained; on per-client close drm->svm is alive and the flush runs.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In nouveau_svmm_fini(), drain the SVM fault handler before freeing svmm by flushing the fault-buffer work; guard the flush with a NULL check on drm->svm.
Event History
Frequently Asked Questions
What conditions are required to trigger the use-after-free?
A Nouveau SVM fault handler must be processing faults for a client while that client's DRM file is closed. The handler can retain and dereference the client's nouveau_svmm after the close path asynchronously frees it.
Is this limited to device removal or suspend?
No. The problematic path is a per-client DRM file close while drm->svm remains active. Device removal and suspend already flush the fault buffer after blocking notifications, so the handler is drained in those paths.