xfs: fix cursor and pointer handling when recovering iunlink buckets
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 04755d2e5821b3afbaadd09fe5df58d04de36484 · < 65f39d09d73718611cee40399179323b5d4ead00| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
xfs: fix cursor and pointer handling when recovering iunlink buckets
LOLLM pointed out a bug in xlog_recover_iunlink_bucket:
1. We don't null out prev_ip after releasing it, which can lead to UAF problems if the inodegc flush call in the loop fails.
at which point I noticed even more bugs:
2. If the inodegc flush inside the loop fails, we also leak @ip.
3. We set prev_agino to agino having already advanced agino, which results in inodes with i_prev_unlinked set to itself.
4. If we exit the bottom of the loop with prev_ip set, then prev_ip aliases ip and we also set its i_prev_unlinked to itself.
From the CVE record · Linux
During XFS iunlink bucket recovery, incorrect pointer and cursor handling can cause a use-after-free or inode leak if an inodegc flush fails, and can create loops in the unlinked list. The input does not specify how an attacker could trigger these conditions, whether access or user interaction is required, or an exploit impact.
Engineers running Linux kernels with XFS should check their exposure; affected versions are not specified.