lib/test_hmm: fail dmirror_fault() when the mirrored mm is gone
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b2ef9f5a5cb37643ca5def3516c546457074b882 · < af7a6d6ec36a16a583ba2e4e9984c3cf1fe34655| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
lib/test_hmm: fail dmirror_fault() when the mirrored mm is gone
dmirror_fault() is called from the dmirror_read() and dmirror_write() retry loops after dmirror_do_read() or dmirror_do_write() finds a missing device page table entry.
If the mirrored mm has already exited, mmget_not_zero() fails. The current code returns 0 in that case, which tells the caller that faulting succeeded even though no page was faulted and no device page table entry was installed. The caller then retries the same address, hits -ENOENT again, and can loop forever without making progress.
Return -EFAULT instead, so the ioctl fails when the mirrored mm is no longer faultable.
From the CVE record · Linux
In the Linux kernel’s lib/test_hmm, dmirror_fault() can report success after the mirrored mm has exited, even though no page was faulted. A local ioctl that reaches the affected read or write retry loop can then retry indefinitely. The input does not specify authentication requirements.
Engineers running Linux kernels that include lib/test_hmm should check whether their version is affected; no affected versions are listed.