{"id":39067,"date":"2026-10-16T00:34:57","date_gmt":"2026-10-15T16:34:57","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-98396"},"modified":"2026-10-16T00:34:57","modified_gmt":"2026-10-15T16:34:57","slug":"cve-2026-98396","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-98396","title":{"rendered":"CVE-2026-98396 &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc: Do not resto"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>powerpc: Do not restore KUAP in arch_exit_to_user_mode_prepare()<\/p>\n<p>KUAP means kernel cannot touch user memory unless it explicitly is<br \/>\nenabled. In the kernel it should stay AMR_KUAP_BLOCKED. While returning<br \/>\nto userspace just before RFI, kernel should restore the user AMR value<br \/>\nback.<\/p>\n<p>Looks like GENERIC_ENTRY might be treating arch_exit_to_user_mode_prepare()<br \/>\nas the last architecture step before returning to userspace.<br \/>\ncommit bee25f97ad24 (&#8220;powerpc: Enable GENERIC_ENTRY feature&#8221;)<br \/>\ntherefore called kuap_user_restore() from that hook. But on PowerPC that<br \/>\nis too early. After irqentry_exit() \/ syscall_exit_to_user_mode() we<br \/>\nstill run platform specific exit routines.<\/p>\n<p>e.g. code snippets showing both exception handling and system call<br \/>\nhandling as the callers of function arch_exit_to_user_mode_prepare()<br \/>\nwhich does kuap_user_restore(). The below path shows that calling<br \/>\nkuap_user_restore() is too early when called from<br \/>\narch_exit_to_user_mode_prepare().<\/p>\n<p>Exception handling in exceptions-64s.S<br \/>\n=======================================<\/p>\n<p>bl\tCFUNC(do_page_fault)<br \/>\n\t  ..DEFINE_INTERRUPT_HANDLER_ASYNC(do_page_fault)<br \/>\n\t      arch_interrupt_async_enter_prepare(regs);<br \/>\n\t      state = irqentry_enter(regs);<br \/>\n\t      instrumentation_begin();<br \/>\n\t      irq_enter_rcu();<br \/>\n\t      handler(regs);<br \/>\n\t      nap_adjust_return(regs);<br \/>\n\t      irq_exit_rcu();<br \/>\n\t      instrumentation_end();<br \/>\n\t      arch_interrupt_async_exit_prepare(regs);<br \/>\n\t      irqentry_exit(regs, state); \t\t   &lt;&lt;&lt; too early<br \/>\n\t        irqentry_exit_to_user_mode()<br \/>\n\t\t  __exit_to_user_mode_prepare(regs, EXIT_TO_USER_MODE_WORK_IRQ);<br \/>\n\t\t    arch_exit_to_user_mode_prepare(regs, ti_work);  &lt;&lt;&lt; too early<br \/>\nb\tinterrupt_return_srr<br \/>\n\t\t.. bl\tCFUNC(interrupt_exit_user_prepare) &lt;&lt;&lt; already calls kuap_user_restore<\/p>\n<p>prep_irq_for_enabled_exit() retry can run kernel code with IRQs on. So<br \/>\nonly when that routine is fully finished is when the user KUAP should be<br \/>\nfully restored which interrupt_exit_user_prepare() already takes care of<br \/>\nbefore returning.<\/p>\n<p>Similarly for system call handling in interrupt_64.S<br \/>\n======================================================<\/p>\n<p>\tbl\tCFUNC(system_call_exception)<\/p>\n<p>.Lsyscall_exit:<br \/>\n\taddi\tr4,r1,STACK_INT_FRAME_REGS<br \/>\n\tli\tr5,0 \/* !scv *\/<br \/>\n\tbl\tCFUNC(syscall_exit_prepare)<br \/>\n\t\t  .. kuap_assert_locked();<br \/>\n\t\t     syscall_exit_to_user_mode(regs); &lt;&lt;&lt; too early<br \/>\n\t\t       syscall_exit_to_user_mode_prepare(regs);  &lt;&lt;&lt; too early<br \/>\n \t\t     kuap_user_restore(regs);         &lt;&lt;&lt; already calls<\/p>\n<p>syscall_exit_prepare(), which can enable IRQs, replay a pending<br \/>\ninterrupt, and only then rfi. Those functions already restore KUAP<br \/>\nimmediately before rfi.<\/p>\n<p>Note that if we restore the user AMR too early like in the current code<br \/>\nas shown from the code snippets above, then we get the following warning<br \/>\nwhen CONFIG_PPC_KUAP_DEBUG is enabled:<br \/>\n  WARNING: arch\/powerpc\/include\/asm\/book3s\/64\/kup.h:293 at interrupt_exit_user_prepare+0x1a0\/0x1c0<br \/>\n  Hardware name: IBM pSeries (emulated by qemu) POWER10 (architected)<br \/>\n  TRAP: 0700<br \/>\n  LR: c00000000000d8d4 CTR: c0000000021fe500<br \/>\n  MSR:   CR: 44000804  XER: 20040000<br \/>\n  interrupt_exit_user_prepare+0x1a0\/0x1c0<br \/>\n  interrupt_return_srr_user+0x8\/0x12c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>powerpc: Do not restore KUAP in arch_exit_to_user_mode_prepare()<\/p>\n<p>KUAP means kernel cannot touch user memory unless it explicitly i<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-39067","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/39067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln"}],"about":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/types\/vuln"}],"wp:attachment":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=39067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=39067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=39067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}