FKIE_CVE-2026-98396
Vulnerability from fkie_nvd - Published: 2026-10-14 14:17 - Updated: 2026-10-19 10:18
Severity
Summary
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 CFUNC(do_page_fault)
..DEFINE_INTERRUPT_HANDLER_ASYNC(do_page_fault)
arch_interrupt_async_enter_prepare(regs);
state = irqentry_enter(regs);
instrumentation_begin();
irq_enter_rcu();
handler(regs);
nap_adjust_return(regs);
irq_exit_rcu();
instrumentation_end();
arch_interrupt_async_exit_prepare(regs);
irqentry_exit(regs, state); <<< too early
irqentry_exit_to_user_mode()
__exit_to_user_mode_prepare(regs, EXIT_TO_USER_MODE_WORK_IRQ);
arch_exit_to_user_mode_prepare(regs, ti_work); <<< too early
b interrupt_return_srr
.. bl CFUNC(interrupt_exit_user_prepare) <<< 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
======================================================
bl CFUNC(system_call_exception)
.Lsyscall_exit:
addi r4,r1,STACK_INT_FRAME_REGS
li r5,0 /* !scv */
bl CFUNC(syscall_exit_prepare)
.. kuap_assert_locked();
syscall_exit_to_user_mode(regs); <<< too early
syscall_exit_to_user_mode_prepare(regs); <<< too early
kuap_user_restore(regs); <<< 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: <SF,EE,ME,IR,DR,RI,LE> CR: 44000804 XER: 20040000
interrupt_exit_user_prepare+0x1a0/0x1c0
interrupt_return_srr_user+0x8/0x12c
References
Impacted products
| Vendor | Product | Version |
|---|
{
"affected": [
{
"affectedData": [
{
"defaultStatus": "unaffected",
"product": "Linux",
"programFiles": [
"arch/powerpc/include/asm/entry-common.h"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"lessThan": "c8e80c19c3b9c8db83a14fab00445a6064992442",
"status": "affected",
"version": "02565a782c1ee7e8ada38ad24a698e01d6ea9ff8",
"versionType": "git"
},
{
"lessThan": "c2549d749539487239475fbc8c614a1f9244d655",
"status": "affected",
"version": "02565a782c1ee7e8ada38ad24a698e01d6ea9ff8",
"versionType": "git"
}
]
},
{
"defaultStatus": "affected",
"product": "Linux",
"programFiles": [
"arch/powerpc/include/asm/entry-common.h"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"status": "affected",
"version": "7.2"
},
{
"lessThan": "7.2",
"status": "unaffected",
"version": "0",
"versionType": "semver"
},
{
"lessThanOrEqual": "7.2.*",
"status": "unaffected",
"version": "7.2.7",
"versionType": "semver"
},
{
"lessThanOrEqual": "*",
"status": "unaffected",
"version": "7.3",
"versionType": "original_commit_for_fix"
}
]
}
],
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
}
],
"cveTags": [],
"descriptions": [
{
"lang": "en",
"value": "In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc: Do not restore KUAP in arch_exit_to_user_mode_prepare()\n\nKUAP means kernel cannot touch user memory unless it explicitly is\nenabled. In the kernel it should stay AMR_KUAP_BLOCKED. While returning\nto userspace just before RFI, kernel should restore the user AMR value\nback.\n\nLooks like GENERIC_ENTRY might be treating arch_exit_to_user_mode_prepare()\nas the last architecture step before returning to userspace.\ncommit bee25f97ad24 (\"powerpc: Enable GENERIC_ENTRY feature\")\ntherefore called kuap_user_restore() from that hook. But on PowerPC that\nis too early. After irqentry_exit() / syscall_exit_to_user_mode() we\nstill run platform specific exit routines.\n\ne.g. code snippets showing both exception handling and system call\nhandling as the callers of function arch_exit_to_user_mode_prepare()\nwhich does kuap_user_restore(). The below path shows that calling\nkuap_user_restore() is too early when called from\narch_exit_to_user_mode_prepare().\n\nException handling in exceptions-64s.S\n=======================================\n\nbl\tCFUNC(do_page_fault)\n\t ..DEFINE_INTERRUPT_HANDLER_ASYNC(do_page_fault)\n\t arch_interrupt_async_enter_prepare(regs);\n\t state = irqentry_enter(regs);\n\t instrumentation_begin();\n\t irq_enter_rcu();\n\t handler(regs);\n\t nap_adjust_return(regs);\n\t irq_exit_rcu();\n\t instrumentation_end();\n\t arch_interrupt_async_exit_prepare(regs);\n\t irqentry_exit(regs, state); \t\t \u003c\u003c\u003c too early\n\t irqentry_exit_to_user_mode()\n\t\t __exit_to_user_mode_prepare(regs, EXIT_TO_USER_MODE_WORK_IRQ);\n\t\t arch_exit_to_user_mode_prepare(regs, ti_work); \u003c\u003c\u003c too early\nb\tinterrupt_return_srr\n\t\t.. bl\tCFUNC(interrupt_exit_user_prepare) \u003c\u003c\u003c already calls kuap_user_restore\n\nprep_irq_for_enabled_exit() retry can run kernel code with IRQs on. So\nonly when that routine is fully finished is when the user KUAP should be\nfully restored which interrupt_exit_user_prepare() already takes care of\nbefore returning.\n\nSimilarly for system call handling in interrupt_64.S\n======================================================\n\n\tbl\tCFUNC(system_call_exception)\n\n.Lsyscall_exit:\n\taddi\tr4,r1,STACK_INT_FRAME_REGS\n\tli\tr5,0 /* !scv */\n\tbl\tCFUNC(syscall_exit_prepare)\n\t\t .. kuap_assert_locked();\n\t\t syscall_exit_to_user_mode(regs); \u003c\u003c\u003c too early\n\t\t syscall_exit_to_user_mode_prepare(regs); \u003c\u003c\u003c too early\n \t\t kuap_user_restore(regs); \u003c\u003c\u003c already calls\n\nsyscall_exit_prepare(), which can enable IRQs, replay a pending\ninterrupt, and only then rfi. Those functions already restore KUAP\nimmediately before rfi.\n\nNote that if we restore the user AMR too early like in the current code\nas shown from the code snippets above, then we get the following warning\nwhen CONFIG_PPC_KUAP_DEBUG is enabled:\n WARNING: arch/powerpc/include/asm/book3s/64/kup.h:293 at interrupt_exit_user_prepare+0x1a0/0x1c0\n Hardware name: IBM pSeries (emulated by qemu) POWER10 (architected)\n TRAP: 0700\n LR: c00000000000d8d4 CTR: c0000000021fe500\n MSR: \u003cSF,EE,ME,IR,DR,RI,LE\u003e CR: 44000804 XER: 20040000\n interrupt_exit_user_prepare+0x1a0/0x1c0\n interrupt_return_srr_user+0x8/0x12c"
}
],
"id": "CVE-2026-98396",
"lastModified": "2026-10-19T10:18:44.197",
"metrics": {},
"published": "2026-10-14T14:17:50.530",
"references": [
{
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"url": "https://git.kernel.org/stable/c/c2549d749539487239475fbc8c614a1f9244d655"
},
{
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"url": "https://git.kernel.org/stable/c/c8e80c19c3b9c8db83a14fab00445a6064992442"
}
],
"sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"vulnStatus": "Received"
}
Loading…
Loading…
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Experimental. This forecast is provided for visualization only and may change without notice. Do not use it for operational decisions.
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
Loading timeline…
Loading…
Loading…
The MITRE ATT&CK techniques below are AI-generated suggestions, inferred from the description of the
vulnerability by the CIRCL/vulnerability-attack-technique-classification-roberta-base
model, served locally by ML-Gateway.
They have not been verified by an analyst and are provided for guidance only.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Loading…
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.