eventfs: Fix use-after-free in eventfs_remove_rec()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
5a43badefe0eccca0c26144c0a44b8d417ce8103| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
eventfs: Fix use-after-free in eventfs_remove_rec()
eventfs_remove_rec() recursively removes the child at the current loop position. After the recursive call returns, list_for_each_entry() advances by reading list.next from the removed child.
If free_ei() drops the final reference, release_ei() reuses the list/rcu union to queue an SRCU callback. The child may be freed before that read. The eventfs_mutex serializes list updates, but it does not keep the removed child alive or prevent the SRCU callback from running.
Use list_for_each_entry_safe() to save the next sibling before recursively removing the current child.
From the CVE record · Linux
A use-after-free in the Linux kernel's eventfs_remove_rec() can occur when it reads a child entry after recursively removing it and that entry has been freed. The input does not establish how an attacker could trigger the flaw or whether access or user interaction is required.
Engineers running the Linux kernel should check whether their version is affected; affected versions are not specified.