In the Linux kernel, the following vulnerability has been resolved:
pagepool: Fix use-after-free in pagepoolrecyclein_ring
syzbot reported a uaf in pagepoolrecycleinring:
BUG: KASAN: slab-use-after-free in lock_release+0x151/0xa30 kernel/locking/lockdep.c:5862 Read of size 8 at addr ffff8880286045a0 by task syz.0.284/6943
CPU: 0 UID: 0 PID: 6943 Comm: syz.0.284 Not tainted 6.13.0-rc3-syzkaller-gdfa94ce54f41 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: <TASK> _dumpstack lib/dumpstack.c:94 [inline] dumpstacklvl+0x241/0x360 lib/dumpstack.c:120 printaddressdescription mm/kasan/report.c:378 [inline] printreport+0x169/0x550 mm/kasan/report.c:489 kasanreport+0x143/0x180 mm/kasan/report.c:602 lockrelease+0x151/0xa30 kernel/locking/lockdep.c:5862 _rawspinunlockbh include/linux/spinlockapismp.h:165 [inline] _rawspinunlockbh+0x1b/0x40 kernel/locking/spinlock.c:210 spinunlockbh include/linux/spinlock.h:396 [inline] ptrringproducebh include/linux/ptrring.h:164 [inline] pagepoolrecycleinring net/core/pagepool.c:707 [inline] pagepoolputunrefednetmem+0x748/0xb00 net/core/pagepool.c:826 pagepoolputnetmem include/net/pagepool/helpers.h:323 [inline] pagepoolputfullnetmem include/net/pagepool/helpers.h:353 [inline] napippputpage+0x149/0x2b0 net/core/skbuff.c:1036 skbpprecycle net/core/skbuff.c:1047 [inline] skbfreehead net/core/skbuff.c:1094 [inline] skbreleasedata+0x6c4/0x8a0 net/core/skbuff.c:1125 skbreleaseall net/core/skbuff.c:1190 [inline] _kfreeskb net/core/skbuff.c:1204 [inline] skskbreasondrop+0x1c9/0x380 net/core/skbuff.c:1242 kfreeskbreason include/linux/skbuff.h:1263 [inline] _skbqueuepurge_reason include/linux/skbuff.h:3343 [inline]
root cause is:
pagepoolrecycleinring ptrringproduce spinlock(&r->producerlock); WRITEONCE(r->queue[r->producer++], ptr) //recycle last page to pool pagepoolrelease pagepoolscrub pagepoolemptyring ptrringconsume pagepoolreturnpage //release all page _pagepooldestroy freepercpu(pool->recyclestats); free(pool) //free
spin_unlock(&r->producer_lock); //pool->ring uaf read
recyclestatinc(pool, ring);
pagepool can be free while page pool recycle the last page in ring. Add producer-lock barrier to pagepool_release to prevent the page pool from being free before all pages have been recycled.
recyclestatinc() is empty when CONFIGPAGEPOOL_STATS is not enabled, which will trigger Wempty-body build warning. Add definition for pool stat macro to fix warning.
[
{
"signature_type": "Function",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4ab8c0f8905c9c4d05e7f437e65a9a365573ff02",
"signature_version": "v1",
"id": "CVE-2025-38129-2a219693",
"digest": {
"function_hash": "232915541484641805731685839964837519780",
"length": 282.0
},
"target": {
"function": "page_pool_recycle_in_ring",
"file": "net/core/page_pool.c"
}
},
{
"signature_type": "Function",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e869a85acc2e60dc554579b910826a4919d8cd98",
"signature_version": "v1",
"id": "CVE-2025-38129-2aec9930",
"digest": {
"function_hash": "305558032817484683490253597255352996899",
"length": 157.0
},
"target": {
"function": "page_pool_release",
"file": "net/core/page_pool.c"
}
},
{
"signature_type": "Function",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4ab8c0f8905c9c4d05e7f437e65a9a365573ff02",
"signature_version": "v1",
"id": "CVE-2025-38129-2b42177c",
"digest": {
"function_hash": "305558032817484683490253597255352996899",
"length": 157.0
},
"target": {
"function": "page_pool_release",
"file": "net/core/page_pool.c"
}
},
{
"signature_type": "Line",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@271683bb2cf32e5126c592b5d5e6a756fa374fd9",
"signature_version": "v1",
"id": "CVE-2025-38129-2bc8cd32",
"digest": {
"threshold": 0.9,
"line_hashes": [
"120816698837380104442744378199995233710",
"300621706553098124420571022830555093139",
"147661803068086501796776517194580039587",
"199643041380826521901059365806447793694",
"89974365295171727909229560989228468397",
"42588145702406156829552091413472511980",
"326597945397023591486371932425514144433",
"198391578000394093077690689436587592041",
"150966067749246518367151219783583311538",
"43436193033333595680682711075886565725",
"285748149828937268649452633248417320854",
"154792983126280337544865700056085200137",
"239924586736892358353586238784605126427",
"119258988697698457769296765622298402469",
"9068731598265613676833381565505762834",
"287941679106325077149940829707434248515",
"62703356996218816252810872643398763836",
"39967247651045528693874320395360908491",
"86625173856001561342563882811535052621",
"246431448699440017925207442226430134136",
"282518405046513108922055179039797111676",
"136891337158411453639130422483154172491",
"95284681407539634392477505263113249685"
]
},
"target": {
"file": "net/core/page_pool.c"
}
},
{
"signature_type": "Function",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e869a85acc2e60dc554579b910826a4919d8cd98",
"signature_version": "v1",
"id": "CVE-2025-38129-7134af2a",
"digest": {
"function_hash": "232915541484641805731685839964837519780",
"length": 282.0
},
"target": {
"function": "page_pool_recycle_in_ring",
"file": "net/core/page_pool.c"
}
},
{
"signature_type": "Line",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4ab8c0f8905c9c4d05e7f437e65a9a365573ff02",
"signature_version": "v1",
"id": "CVE-2025-38129-76eb2fd7",
"digest": {
"threshold": 0.9,
"line_hashes": [
"120816698837380104442744378199995233710",
"300621706553098124420571022830555093139",
"147661803068086501796776517194580039587",
"199643041380826521901059365806447793694",
"89974365295171727909229560989228468397",
"42588145702406156829552091413472511980",
"326597945397023591486371932425514144433",
"198391578000394093077690689436587592041",
"150966067749246518367151219783583311538",
"43436193033333595680682711075886565725",
"285748149828937268649452633248417320854",
"154792983126280337544865700056085200137",
"239924586736892358353586238784605126427",
"119258988697698457769296765622298402469",
"9068731598265613676833381565505762834",
"287941679106325077149940829707434248515",
"62703356996218816252810872643398763836",
"39967247651045528693874320395360908491",
"86625173856001561342563882811535052621",
"246431448699440017925207442226430134136",
"282518405046513108922055179039797111676",
"136891337158411453639130422483154172491",
"95284681407539634392477505263113249685"
]
},
"target": {
"file": "net/core/page_pool.c"
}
},
{
"signature_type": "Function",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@271683bb2cf32e5126c592b5d5e6a756fa374fd9",
"signature_version": "v1",
"id": "CVE-2025-38129-acfb2fd9",
"digest": {
"function_hash": "232915541484641805731685839964837519780",
"length": 282.0
},
"target": {
"function": "page_pool_recycle_in_ring",
"file": "net/core/page_pool.c"
}
},
{
"signature_type": "Function",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@271683bb2cf32e5126c592b5d5e6a756fa374fd9",
"signature_version": "v1",
"id": "CVE-2025-38129-cc2bf425",
"digest": {
"function_hash": "305558032817484683490253597255352996899",
"length": 157.0
},
"target": {
"function": "page_pool_release",
"file": "net/core/page_pool.c"
}
},
{
"signature_type": "Line",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e869a85acc2e60dc554579b910826a4919d8cd98",
"signature_version": "v1",
"id": "CVE-2025-38129-e1484545",
"digest": {
"threshold": 0.9,
"line_hashes": [
"120816698837380104442744378199995233710",
"300621706553098124420571022830555093139",
"147661803068086501796776517194580039587",
"199643041380826521901059365806447793694",
"89974365295171727909229560989228468397",
"42588145702406156829552091413472511980",
"326597945397023591486371932425514144433",
"198391578000394093077690689436587592041",
"150966067749246518367151219783583311538",
"43436193033333595680682711075886565725",
"285748149828937268649452633248417320854",
"154792983126280337544865700056085200137",
"239924586736892358353586238784605126427",
"119258988697698457769296765622298402469",
"9068731598265613676833381565505762834",
"287941679106325077149940829707434248515",
"62703356996218816252810872643398763836",
"39967247651045528693874320395360908491",
"86625173856001561342563882811535052621",
"246431448699440017925207442226430134136",
"282518405046513108922055179039797111676",
"136891337158411453639130422483154172491",
"95284681407539634392477505263113249685"
]
},
"target": {
"file": "net/core/page_pool.c"
}
}
]