{"id":"DEBIAN-CVE-2026-98396","details":"In the Linux kernel, the following vulnerability has been resolved:  powerpc: Do not restore KUAP in arch_exit_to_user_mode_prepare()  KUAP means kernel cannot touch user memory unless it explicitly is enabled. In the kernel it should stay AMR_KUAP_BLOCKED. While returning to userspace just before RFI, kernel should restore the user AMR value back.  Looks like GENERIC_ENTRY might be treating arch_exit_to_user_mode_prepare() as the last architecture step before returning to userspace. commit bee25f97ad24 (\"powerpc: Enable GENERIC_ENTRY feature\") therefore called kuap_user_restore() from that hook. But on PowerPC that is too early. After irqentry_exit() / syscall_exit_to_user_mode() we still run platform specific exit routines.  e.g. code snippets showing both exception handling and system call handling as the callers of function arch_exit_to_user_mode_prepare() which does kuap_user_restore(). The below path shows that calling kuap_user_restore() is too early when called from arch_exit_to_user_mode_prepare().  Exception handling in exceptions-64s.S =======================================  bl\tCFUNC(do_page_fault) \t  ..DEFINE_INTERRUPT_HANDLER_ASYNC(do_page_fault) \t      arch_interrupt_async_enter_prepare(regs); \t      state = irqentry_enter(regs); \t      instrumentation_begin(); \t      irq_enter_rcu(); \t      handler(regs); \t      nap_adjust_return(regs); \t      irq_exit_rcu(); \t      instrumentation_end(); \t      arch_interrupt_async_exit_prepare(regs); \t      irqentry_exit(regs, state); \t\t   \u003c\u003c\u003c too early \t        irqentry_exit_to_user_mode() \t\t  __exit_to_user_mode_prepare(regs, EXIT_TO_USER_MODE_WORK_IRQ); \t\t    arch_exit_to_user_mode_prepare(regs, ti_work);  \u003c\u003c\u003c too early b\tinterrupt_return_srr \t\t.. bl\tCFUNC(interrupt_exit_user_prepare) \u003c\u003c\u003c already calls kuap_user_restore  prep_irq_for_enabled_exit() retry can run kernel code with IRQs on. So only when that routine is fully finished is when the user KUAP should be fully restored which interrupt_exit_user_prepare() already takes care of before returning.  Similarly for system call handling in interrupt_64.S ======================================================  \tbl\tCFUNC(system_call_exception)  .Lsyscall_exit: \taddi\tr4,r1,STACK_INT_FRAME_REGS \tli\tr5,0 /* !scv */ \tbl\tCFUNC(syscall_exit_prepare) \t\t  .. kuap_assert_locked(); \t\t     syscall_exit_to_user_mode(regs); \u003c\u003c\u003c too early \t\t       syscall_exit_to_user_mode_prepare(regs);  \u003c\u003c\u003c too early  \t\t     kuap_user_restore(regs);         \u003c\u003c\u003c already calls  syscall_exit_prepare(), which can enable IRQs, replay a pending interrupt, and only then rfi. Those functions already restore KUAP immediately before rfi.  Note that if we restore the user AMR too early like in the current code as shown from the code snippets above, then we get the following warning when CONFIG_PPC_KUAP_DEBUG is enabled:   WARNING: arch/powerpc/include/asm/book3s/64/kup.h:293 at interrupt_exit_user_prepare+0x1a0/0x1c0   Hardware name: IBM pSeries (emulated by qemu) POWER10 (architected)   TRAP: 0700   LR: c00000000000d8d4 CTR: c0000000021fe500   MSR: \u003cSF,EE,ME,IR,DR,RI,LE\u003e  CR: 44000804  XER: 20040000   interrupt_exit_user_prepare+0x1a0/0x1c0   interrupt_return_srr_user+0x8/0x12c","modified":"2026-10-15T05:01:53.859655391Z","published":"2026-10-14T14:17:50.530Z","upstream":["CVE-2026-98396"],"references":[{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2026-98396"}],"affected":[{"package":{"name":"linux","ecosystem":"Debian:14","purl":"pkg:deb/debian/linux?arch=source&distro=forky"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"7.2.7-1"}]}],"versions":["6.12.100-1","6.12.101-1","6.12.105-1","6.12.107-1","6.12.111-1","6.12.38-1","6.12.41-1","6.12.43-1","6.12.43-1~bpo12+1","6.12.48-1","6.12.57-1","6.12.57-1~bpo12+1","6.12.63-1","6.12.63-1~bpo12+1","6.12.69-1","6.12.69-1~bpo12+1","6.12.73-1","6.12.73-1~bpo12+1","6.12.74-1","6.12.74-2","6.12.74-2~bpo12+1","6.12.85-1","6.12.85-1~bpo12+1","6.12.86-1","6.12.86-1~bpo12+1","6.12.88-1","6.12.88-1~bpo12+1","6.12.90-1","6.12.90-1~bpo12+1","6.12.90-2","6.12.90-2~bpo12+1","6.12.94-1","6.12.94-1~bpo12+1","6.12.95-1","6.12.95-1~bpo12+1","6.12.96-1","6.13.10-1~exp1","6.13.11-1~exp1","6.13.2-1~exp1","6.13.3-1~exp1","6.13.4-1~exp1","6.13.5-1~exp1","6.13.6-1~exp1","6.13.7-1~exp1","6.13.8-1~exp1","6.13.9-1~exp1","6.13~rc6-1~exp1","6.13~rc7-1~exp1","6.14.3-1~exp1","6.14.5-1~exp1","6.14.6-1~exp1","6.15-1~exp1","6.15.1-1~exp1","6.15.2-1~exp1","6.15.3-1~exp1","6.15.4-1~exp1","6.15.5-1~exp1","6.15.6-1~exp1","6.15~rc7-1~exp1","6.16-1~exp1","6.16.1-1~exp1","6.16.10-1","6.16.11-1","6.16.12-1","6.16.12-1~bpo13+1","6.16.12-2","6.16.3-1","6.16.3-1~bpo13+1","6.16.5-1","6.16.6-1","6.16.7-1","6.16.8-1","6.16.9-1","6.16~rc7-1~exp1","6.17.10-1","6.17.11-1","6.17.12-1","6.17.13-1","6.17.13-1~bpo13+1","6.17.2-1~exp1","6.17.5-1~exp1","6.17.6-1","6.17.7-1","6.17.7-2","6.17.8-1","6.17.8-1~bpo13+1","6.17.9-1","6.18.1-1~exp1","6.18.10-1","6.18.12-1","6.18.12-1~bpo13+1","6.18.13-1","6.18.14-1","6.18.15-1","6.18.15-1~bpo13+1","6.18.2-1~exp1","6.18.3-1","6.18.5-1","6.18.5-1~bpo13+1","6.18.8-1","6.18.9-1","6.18.9-1~bpo13+1","6.18~rc4-1~exp1","6.18~rc4-1~exp2","6.18~rc5-1~exp1","6.18~rc6-1~exp1","6.18~rc7-1~exp1","6.19-1~exp1","6.19.10-1","6.19.10-1~bpo13+1","6.19.11-1","6.19.11-1~bpo13+1","6.19.12-1","6.19.13-1","6.19.13-1~bpo13+1","6.19.14-1","6.19.14-1~bpo13+1","6.19.2-1~exp1","6.19.3-1~exp1","6.19.4-1~exp1","6.19.5-1~exp1","6.19.6-1","6.19.6-2","6.19.6-2~bpo13+1","6.19.8-1","6.19.8-1~bpo13+1","6.19~rc4-1~exp1","6.19~rc5-1~exp1","6.19~rc6-1~exp1","6.19~rc7-1~exp1","6.19~rc8-1~exp1","7.0-1~exp1","7.0.1-1~exp1","7.0.10-1","7.0.10-1~bpo13+1","7.0.12-1","7.0.12-2","7.0.12-2~bpo13+1","7.0.13-1","7.0.13-1~bpo13+1","7.0.14-1","7.0.3-1","7.0.4-1","7.0.4-1~bpo13+1","7.0.7-1","7.0.7-1~bpo13+1","7.0.9-1","7.0.9-1~bpo13+1","7.1.1-1~exp1","7.1.10-1","7.1.12-1","7.1.13-1","7.1.13-1~bpo13+1","7.1.2-1~exp1","7.1.3-1","7.1.3-1+sunvdc","7.1.3-1~bpo13+1","7.1.4-1","7.1.5-1","7.1.6-1","7.1.7-1","7.1.7-1~bpo13+1","7.1.8-1","7.1.8-1~bpo13+1","7.1.8-2","7.1.9-1","7.1.9-1+sparc64","7.1~rc2-1~exp1","7.1~rc3-1~exp1","7.1~rc4-1~exp1","7.1~rc4-1~exp2","7.1~rc5-1~exp1","7.1~rc7-1~exp1","7.2.2-1~exp1","7.2.3-1~exp1","7.2.6-1","7.2.6-1~bpo13+1","7.2~rc3-1~exp1","7.2~rc5-1~exp1","7.2~rc7-1~exp1"],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-98396.json"}}],"schema_version":"1.9.0"}