12 #include <linux/module.h>
14 #include <linux/slab.h>
16 #include <asm/uaccess.h>
45 static void fudze_exception_table(
void *
marker,
void *
new)
56 if (mod->num_exentries > 1) {
62 extable[0].
insn = (
unsigned long)
new;
85 fudze_exception_table(&
foo_label, address);
89 "0: call *%[fake_code]\n"
91 ".section .fixup,\"ax\"\n"
92 "2: mov %[zero], %[rslt]\n"
96 : [rslt]
"=r" (result)
97 : [fake_code]
"r" (address), [
zero]
"r" (0
UL),
"0" (result)
100 fudze_exception_table(address, &
foo_label);
107 static unsigned char test_data = 0xC3;
109 static int test_NX(
void)
113 char stackcode[] = {0xC3, 0x90, 0 };
121 if (test_address(&stackcode)) {
133 if (test_address(heap)) {
145 #ifdef CONFIG_DEBUG_RODATA
147 if (rodata_test_data != 0xC3) {
150 }
else if (test_address(&rodata_test_data)) {
158 if (test_address(&test_data)) {
167 static void test_exit(
void)