{"id":"CVE-2026-98818","kind":"vulnerability","aliases":["CVE-2026-98818"],"related":[],"title":"Linux kernel: kfree_rcu may wake kswapd under scheduler lock, causing deadlock","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/slab: do not wake up kswapd in __kfree_rcu_sheaf()\n\nSince kfree_rcu() can be called under pi_lock (a raw spinlock in the\nscheduler), kfree_rcu() itself should never allocate memory with\n__GFP_KSWAPD_RECLAIM as waking up kswapd ends up acquiring pi_lock,\nwhich leads to a deadlock.\n\nReproducing the issue even intentionally was not straightforward.\nThe set_cpus_allowed_force() path that is called under pi_lock is\nexercised very rarely, and competing tasks that allocate memory will\nmost likely wake kswapd up.\n\nTherefore the existence of the deadlock was verified with a modified\nkernel that has a lockdep map for waking up kswapd:\n\n  ======================================================\n  WARNING: possible circular locking dependency detected\n  7.2.0-rc1-slab-for-next+ #10 Not tainted\n  ------------------------------------------------------\n  git/6660 is trying to acquire lock:\n  ffff8e524533c550 (&p->pi_lock){-.-.}-{2:2}, at: _raw_spin_lock_irqsave+0x12/0x20\n\n  but task is already holding lock:\n  ffff8e57bffff1a0 (&pgdat->kswapd_wait){....}-{3:3}, at: _raw_spin_lock_irqsave+0x12/0x20\n\n  which lock already depends on the new lock.\n\n  the existing dependency chain (in reverse order) is:\n\n  -> #2 (&pgdat->kswapd_wait){....}-{3:3}:\n         __lock_acquire+0x5a4/0xc50\n         lock_acquire.part.0+0xb7/0x240\n         lock_acquire+0x70/0x170\n         __raw_spin_lock_irqsave+0x44/0x80\n         _raw_spin_lock_irqsave+0x12/0x20\n         __wake_up_common_lock+0x31/0xa0\n         __wake_up+0x20/0x40\n         kswapd_wakeup_wake+0x7e/0x110\n         wakeup_kswapd+0x295/0x320\n         wake_all_kswapds+0xac/0x1a0\n         __alloc_pages_slowpath.constprop.0+0x282/0xf80\n         __alloc_frozen_pages_noprof+0x32a/0x360\n         alloc_slab_page+0x2e/0x160\n         allocate_slab+0x82/0x420\n         new_slab+0x52/0xb0\n         refill_objects+0x13d/0x190\n         refill_sheaf+0x5d/0xd0\n         __pcs_replace_empty_main+0x230/0xb10\n         [...]\n\n  -> #1 (kswapd_wakeup){-.-.}-{0:0}:\n         __lock_acquire+0x5a4/0xc50\n         lock_sync.part.0+0x75/0x100\n         lock_sync+0x36/0x70\n         might_wakeup_kswapd+0x61/0xa0\n         __kfree_rcu_sheaf+0x33/0xd90\n         kvfree_call_rcu+0x1d4/0x3b0\n         set_cpus_allowed_force+0x163/0x220\n         cpuset_cpus_allowed_fallback+0x18b/0x240\n         select_fallback_rq+0x1e6/0x250\n\t [...]\n\n  -> #0 (&p->pi_lock){-.-.}-{2:2}:\n         check_prev_add+0xe6/0xe00\n         validate_chain+0x51e/0x6e0\n         __lock_acquire+0x5a4/0xc50\n         lock_acquire.part.0+0xb7/0x240\n         lock_acquire+0x70/0x170\n         __raw_spin_lock_irqsave+0x44/0x80\n         _raw_spin_lock_irqsave+0x12/0x20\n         try_to_wake_up+0x77/0xa90\n         default_wake_function+0x27/0x60\n         autoremove_wake_function+0x23/0xb0\n         __wake_up_common+0xb8/0x170\n         __wake_up_common_lock+0x51/0xa0\n         __wake_up+0x20/0x40\n         kswapd_wakeup_wake+0x7e/0x110\n         wakeup_kswapd+0x295/0x320\n         wake_all_kswapds+0xac/0x1a0\n         __alloc_pages_slowpath.constprop.0+0x282/0xf80\n         __alloc_frozen_pages_noprof+0x32a/0x360\n         alloc_slab_page+0x2e/0x160\n         allocate_slab+0x82/0x420\n         new_slab+0x52/0xb0\n         refill_objects+0x13d/0x190\n         refill_sheaf+0x5d/0xd0\n         __pcs_replace_empty_main+0x230/0xb10\n         [...]\n\n  other info that might help us debug this:\n\n  Chain exists of:\n    &p->pi_lock --> kswapd_wakeup --> &pgdat->kswapd_wait\n\n   Possible unsafe locking scenario:\n\n         CPU0                    CPU1\n         ----                    ----\n    lock(&pgdat->kswapd_wait);\n                                 lock(kswapd_wakeup);\n                                 lock(&pgdat->kswapd_wait);\n    lock(&p->pi_lock);\n\n   *** DEADLOCK ***\n\n  3 locks held by git/6660:\n   #0: ffff8e519f0e9e20 (&type->i_mutex_dir_key#6){++++}-{4:4}, at: lookup_slow+0x2d/0x60\n   #1: ffffffff8a31c460 (kswapd_wakeup){-.-.}-\n---truncated---","summary":"In the Linux kernel's slab allocator, kfree_rcu() could wake kswapd while the caller holds the scheduler's pi_lock, creating a circular lock dependency. The sources describe a deadlock, not a code-execution or data-disclosure path.","severity":"unknown","cvss":null,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["linux-kernel","runtime","self-hosted"],"not_affected_if":["patched-kernel"],"how_to_check":"- Run `uname -r` and compare against the fixed kernel versions listed in the NVD entry\n- unknown if the sources give further detail","fix":"- Update to a Linux kernel release that includes the upstream commit 'mm/slab: do not wake up kswapd in __kfree_rcu_sheaf()' (version unknown from sources)\n- unknown for exact fixed version","status":"open","published_at":"2026-10-18T16:17:36+00:00","first_seen_at":"2026-10-23T21:57:17+00:00","triaged_at":"2026-10-25T05:14:45+00:00","updated_at":"2026-10-25T05:14:45+00:00","category":"runtime","confidence":0.5,"triage":{"at":"2026-10-25T05:14:45Z","model":"claude-haiku-5-5","output":{"fix":"- Update to a Linux kernel release that includes the upstream commit 'mm/slab: do not wake up kswapd in __kfree_rcu_sheaf()' (version unknown from sources)\n- unknown for exact fixed version","reach":"local","title":"Linux kernel: kfree_rcu may wake kswapd under scheduler lock, causing deadlock","impact":"low","summary":"In the Linux kernel's slab allocator, kfree_rcu() could wake kswapd while the caller holds the scheduler's pi_lock, creating a circular lock dependency. The sources describe a deadlock, not a code-execution or data-disclosure path.","category":"runtime","nicknames":[],"who_cares":["linux-kernel","self-hosted"],"confidence":0.5,"needs_auth":"unknown","worst_case":"Kernel deadlock causing system hang or denial of service","analyst_note":"Confirm affected and fixed kernel version ranges from the NVD entry and the upstream kernel.org commit.","how_to_check":"- Run `uname -r` and compare against the fixed kernel versions listed in the NVD entry\n- unknown if the sources give further detail","needs_analyst":true,"not_affected_if":["patched-kernel"],"who_is_affected":"Systems running an affected Linux kernel where set_cpus_allowed_force() or the CPU fallback path can run kfree_rcu() under pi_lock; the sources say this path is rarely exercised. Systems on unaffected or patched kernels can skip it. Further detail unknown.","user_interaction":"no","needs_special_setup":"unknown","severity_if_unknown":"unknown"},"cost_usd":0.000802,"input_tokens":5169,"output_tokens":570,"severity_before":"unknown"},"analyst_status":null,"analyst_note":null,"search":"'+0':216C,235C,261C,265C,269C,275C,281C,287C,291C,296C,300C,305C,309C,315C,320C,324C,328C,332C,336C,342C,351C,355C,359C,364C,369C,374C,380C,386C,391C,402C,406C,410C,414C,418C,424C,430C,436C,441C,446C,451C,457C,461C,466C,470C,475C,479C,485C,490C,494C,498C,502C,506C,512C,573C '-2026':14A,17A '-98818':15A,18A '0':264C,308C,347C,348C,354C,393C,413C,478C,560C '1':344C,575C '10':196C '2':209C,210C,253C,397C,398C '3':228C,229C,257C,258C,555C '4':568C,569C '6':567C '7.2.0':190C 'acquir':119C,203C,260C,268C,350C,409C,417C 'add':401C 'alloc':32B,107C,155C,311C,317C,322C,481C,487C,492C 'alloc_pages_slowpath.constprop':307C,477C 'allow':138C,378C,384C 'alreadi':221C,239C 'autoremov':443C 'call':92C,143C,372C 'caller':40B 'caus':11A 'chain':248C,405C,522C 'check':399C 'circular':49B,186C 'code':60B 'code-execut':59B 'common':285C,450C,455C 'compet':152C 'could':35B 'cpu0':537C 'cpu1':538C 'cpus':137C,377C,383C 'cpuset':382C 'creat':47B 'cve':13A,16A 'data':64B 'data-disclosur':63B 'deadlock':12A,56B,126C,168C,554C 'debug':520C 'default':438C 'depend':51B,188C,240C,247C 'describ':54B 'detect':189C 'dir':565C 'disclosur':65B 'empti':340C,510C 'end':117C 'even':130C 'execut':61B 'exercis':148C 'exist':165C,246C,523C 'fallback':385C,389C 'ffff8e519f0e9e20':561C 'ffff8e524533c550':205C 'ffff8e57bffff1a0':224C 'ffffffff8a31c460':576C 'follow':72C 'forc':139C,379C 'frozen':312C,482C 'function':440C,445C 'gfp':110C 'git/6660':199C,559C 'held':557C 'help':518C 'hold':41B,222C 'host':25B 'info':515C 'intent':131C 'irqsav':215C,234C,274C,280C,423C,429C 'issu':129C 'kernel':2A,21B,29B,70C,174C 'key':566C 'kfree':3A,33B,84C,88C,102C,366C 'kswapd':7A,37B,82C,111C,116C,161C,183C,226C,255C,293C,299C,304C,345C,363C,463C,469C,474C,528C,531C,541C,544C,548C,577C 'kvfree':371C 'lead':123C 'like':159C 'linux':1A,20B,28B,69C 'linux-kernel':19B 'lock':10A,46B,50B,95C,121C,146C,187C,204C,208C,214C,223C,233C,238C,244C,259C,267C,273C,279C,286C,349C,357C,396C,408C,416C,422C,428C,456C,527C,535C,539C,543C,546C,550C,553C,556C 'lock_acquire.part':263C,412C 'lock_sync.part':353C 'lockdep':178C 'lookup':571C 'main':341C,511C 'map':179C 'may':5A 'memori':108C,156C 'might':361C,517C 'mm/slab':77C 'modifi':173C 'mutex':564C 'never':106C 'new':243C,326C,496C 'next':195C 'noprof':314C,484C 'object':331C,501C 'order':251C 'p':206C,394C,525C,551C 'page':313C,319C,483C,489C 'path':66B,140C 'pcs':338C,508C 'pgdat':225C,254C,530C,540C,547C 'pi':45B,94C,120C,145C,207C,395C,526C,552C 'possibl':185C,533C 'prev':400C 'rare':150C 'raw':97C,212C,231C,271C,277C,420C,426C 'rc1':192C 'rc1-slab-for-next':191C 'rcu':4A,34B,85C,89C,103C,367C,373C 'reclaim':112C 'refil':330C,334C,500C,504C 'replac':339C,509C 'reproduc':127C 'resolv':76C 'revers':250C 'rq':390C 'runtim':22B 'scenario':536C 'schedul':9A,43B,101C 'select':388C 'self':24B 'self-host':23B 'set':136C,376C 'sheaf':86C,335C,368C,505C 'sinc':87C 'slab':31B,193C,318C,323C,327C,488C,493C,497C 'slow':572C 'sourc':53B 'spin':213C,232C,272C,278C,421C,427C 'spinlock':98C 'straightforward':134C 'sync':358C 'taint':198C 'task':153C,219C 'therefor':163C 'tri':201C,432C 'truncat':579C 'type':562C 'unsaf':534C 'us':519C 'valid':404C 'verifi':170C 'vulner':73C 'wait':227C,256C,532C,542C,549C 'wake':6A,36B,80C,114C,160C,181C,283C,289C,295C,302C,434C,439C,444C,448C,453C,459C,465C,472C 'wakeup':294C,298C,346C,362C,464C,468C,529C,545C,578C 'warn':184C 'x12/0x20':217C,236C,282C,431C 'x13d/0x190':333C,503C 'x163/0x220':381C 'x18b/0x240':387C 'x1d4/0x3b0':375C 'x1e6/0x250':392C 'x20/0x40':292C,462C 'x23/0xb0':447C 'x230/0xb10':343C,513C 'x27/0x60':442C 'x282/0xf80':310C,480C 'x295/0x320':301C,471C 'x2d/0x60':574C 'x2e/0x160':321C,491C 'x31/0xa0':288C 'x32a/0x360':316C,486C 'x33/0xd90':370C 'x36/0x70':360C 'x44/0x80':276C,425C 'x51/0xa0':458C 'x51e/0x6e0':407C 'x52/0xb0':329C,499C 'x5a4/0xc50':262C,352C,411C 'x5d/0xd0':337C,507C 'x61/0xa0':365C 'x70/0x170':270C,419C 'x75/0x100':356C 'x77/0xa90':437C 'x7e/0x110':297C,467C 'x82/0x420':325C,495C 'xac/0x1a0':306C,476C 'xb7/0x240':266C,415C 'xb8/0x170':452C 'xe6/0xe00':403C","nicknames":[],"mitigations":[],"who_affected":"Systems running an affected Linux kernel where set_cpus_allowed_force() or the CPU fallback path can run kfree_rcu() under pi_lock; the sources say this path is rarely exercised. Systems on unaffected or patched kernels can skip it. Further detail unknown.","tier":"C","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-18T16:17:36+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-98818","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-98818","severity":null,"published_at":"2026-10-18T16:17:36+00:00","modified_at":"2026-10-19T10:19:45+00:00","first_seen_at":"2026-10-23T21:57:17+00:00","fetched_at":"2026-10-23T22:28:56+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}