erofs: fix use-after-free on sbi->sync_decompress
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 40452ffca3c1a0f2994e826f9fa213b107f1a2d4 · < 1aee05e814d292064bf5fa15733741040cdc48ba| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
erofs: fix use-after-free on sbi->sync_decompress
z_erofs_decompress_kickoff() can race with filesystem unmount, causing a use-after-free on sbi->sync_decompress.
When I/O completes, z_erofs_endio() calls z_erofs_decompress_kickoff() to queue z_erofs_decompressqueue_work() asynchronously. Then, after all folios are unlocked, unmount workflow can proceed and sbi will be freed before accessing to sbi->sync_decompress.
Thread (unmount) I/O completion kworker queue_work z_erofs_decompressqueue_work (all folios are unlocked) cleanup_mnt .. erofs_kill_sb erofs_sb_free kfree(sbi) access sbi->sync_decompress // UAF!!
From the CVE record · Linux
The Linux kernel's EROFS decompression path can access freed memory when I/O completion races with filesystem unmount. This can happen after the unmount frees filesystem state but before queued decompression work accesses it; attacker access, authentication and user-interaction requirements are not specified.
Engineers running Linux kernels with EROFS should check their systems; affected versions are not specified.