net: page_pool: fix use-after-free in page_pool_recycle_ring_bulk()
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 |
|
|
6.18.567.2.107.3In the Linux kernel, the following vulnerability has been resolved:
net: page_pool: fix use-after-free in page_pool_recycle_ring_bulk()
With CONFIG_PAGE_POOL_STATS=y, page_pool_recycle_ring_bulk() updates the recycle stats after dropping the producer lock. If it just recycled the last inflight netmems of a pool being destroyed, page_pool_release() can pass its producer-lock barrier and free the pool before recycle_stat_add() runs.
Commit fcc680a647ba7 ("page_pool: allow mixing PPs within one bulk") moved this stat update after the unlock. Commit 271683bb2cf32 ("page_pool: Fix use-after-free in page_pool_recycle_in_ring") later added the barrier, but only fixed page_pool_recycle_in_ring(). Move the update back under the lock.
From the CVE record · Linux
The Linux kernel has a use-after-free in page_pool_recycle_ring_bulk() when CONFIG_PAGE_POOL_STATS=y. If the function recycles the last inflight netmems of a pool being destroyed, the pool can be freed before its recycle statistics are updated. The input does not establish whether an attacker can trigger this or specify access or user-interaction requirements.
Engineers running Linux kernels with CONFIG_PAGE_POOL_STATS=y should check whether their kernel includes the fix; affected versions are not specified.