|
17 | 17 | #include <linux/kernel.h>
|
18 | 18 | #include <linux/errno.h>
|
19 | 19 | #include <linux/string.h>
|
| 20 | +#include <linux/string_choices.h> |
20 | 21 | #include <linux/types.h>
|
21 | 22 | #include <linux/pagemap.h>
|
22 | 23 | #include <linux/ptrace.h>
|
@@ -218,7 +219,7 @@ static bool bad_kernel_fault(struct pt_regs *regs, unsigned long error_code,
|
218 | 219 | // Read/write fault blocked by KUAP is bad, it can never succeed.
|
219 | 220 | if (bad_kuap_fault(regs, address, is_write)) {
|
220 | 221 | pr_crit_ratelimited("Kernel attempted to %s user page (%lx) - exploit attempt? (uid: %d)\n",
|
221 |
| - is_write ? "write" : "read", address, |
| 222 | + str_write_read(is_write), address, |
222 | 223 | from_kuid(&init_user_ns, current_uid()));
|
223 | 224 |
|
224 | 225 | // Fault on user outside of certain regions (eg. copy_tofrom_user()) is bad
|
@@ -625,7 +626,7 @@ static void __bad_page_fault(struct pt_regs *regs, int sig)
|
625 | 626 | case INTERRUPT_DATA_STORAGE:
|
626 | 627 | case INTERRUPT_H_DATA_STORAGE:
|
627 | 628 | pr_alert("BUG: %s on %s at 0x%08lx\n", msg,
|
628 |
| - is_write ? "write" : "read", regs->dar); |
| 629 | + str_write_read(is_write), regs->dar); |
629 | 630 | break;
|
630 | 631 | case INTERRUPT_DATA_SEGMENT:
|
631 | 632 | pr_alert("BUG: %s at 0x%08lx\n", msg, regs->dar);
|
|
0 commit comments