fault.c (5250d026d241febfaf226d26cabe528fc478e225) fault.c (3dc12dfe74300febc568c3b530c0f9bee01f2821)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * PowerPC version
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
5 *
6 * Derived from "arch/i386/mm/fault.c"
7 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
8 *

--- 214 unchanged lines hidden (view full) ---

223
224 // Fault on user outside of certain regions (eg. copy_tofrom_user()) is bad
225 if (!search_exception_tables(regs->nip))
226 return true;
227
228 // Read/write fault in a valid region (the exception table search passed
229 // above), but blocked by KUAP is bad, it can never succeed.
230 if (bad_kuap_fault(regs, address, is_write))
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * PowerPC version
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
5 *
6 * Derived from "arch/i386/mm/fault.c"
7 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
8 *

--- 214 unchanged lines hidden (view full) ---

223
224 // Fault on user outside of certain regions (eg. copy_tofrom_user()) is bad
225 if (!search_exception_tables(regs->nip))
226 return true;
227
228 // Read/write fault in a valid region (the exception table search passed
229 // above), but blocked by KUAP is bad, it can never succeed.
230 if (bad_kuap_fault(regs, address, is_write))
231 return true;
231 return WARN(true, "Bug: %s fault blocked by KUAP!", is_write ? "Write" : "Read");
232
233 // What's left? Kernel fault on user in well defined regions (extable
234 // matched), and allowed by KUAP in the faulting context.
235 return false;
236}
237
238#ifdef CONFIG_PPC_MEM_KEYS
239static bool access_pkey_error(bool is_write, bool is_exec, bool is_pkey,

--- 366 unchanged lines hidden ---
232
233 // What's left? Kernel fault on user in well defined regions (extable
234 // matched), and allowed by KUAP in the faulting context.
235 return false;
236}
237
238#ifdef CONFIG_PPC_MEM_KEYS
239static bool access_pkey_error(bool is_write, bool is_exec, bool is_pkey,

--- 366 unchanged lines hidden ---