filemap: Handle sibling entries in filemap_get_read_batch()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
filemap: Handle sibling entries in filemap_get_read_batch()
If a read races with an invalidation followed by another read, it is possible for a folio to be replaced with a higher-order folio. If that happens, we'll see a sibling entry for the new folio in the next iteration of the loop. This manifests as a NULL pointer dereference while holding the RCU read lock.
Handle this by simply returning. The next call will find the new folio and handle it correctly. The other ways of handling this rare race are more complex and it's just not worth it.
From the CVE record · Linux
A race between a read, an invalidation, and another read can cause filemap_get_read_batch() to encounter a sibling entry and dereference a NULL pointer. The input does not specify how an attacker could trigger the race or whether authentication or user interaction is required.
Engineers running the Linux kernel should check their deployments; affected versions are not specified.