Lines Matching refs:stack
25 * Make sure our attempts to over run the kernel stack doesn't trigger
41 * Make sure compiler does not optimize this function or stack frame away:
43 * - stack variables are marked volatile
44 * - stack variables are written (memset()) and read (buf[..] passed as arg)
109 pr_info("FAIL: survived without exhausting stack?!\n");
112 static noinline void __lkdtm_CORRUPT_STACK(void *stack)
114 memset(stack, '\xff', 64);
117 /* This should trip the stack canary, not corrupt the return address. */
120 /* Use default char array length that triggers stack protection. */
123 pr_info("Corrupting stack containing char array ...\n");
135 pr_info("Corrupting stack containing union ...\n");
148 pr_info("Starting stack offset tracking for pid %d\n", pid);
160 static noinline void __lkdtm_REPORT_STACK_CANARY(void *stack)
164 unsigned long *canary = (unsigned long *)stack;
169 canary = (unsigned long *)stack + i;
181 * we're either using a global canary or the stack frame
185 pr_err("FAIL: global stack canary found at offset %ld (canary for pid %d matches init_task's)!\n",
188 pr_warn("FAIL: did not correctly locate stack canary :(\n");
197 canary = (unsigned long *)stack + current_offset;
202 pr_info("Recorded stack canary for pid %d at offset %ld\n",
217 pr_info("ok: stack canaries differ between pid %d and pid %d at offset %ld.\n",
227 /* Use default char array length that triggers stack protection. */
470 const unsigned char *stack = task_stack_page(current);
471 const unsigned char *ptr = stack - 1;
474 pr_info("attempting bad read from page below current stack\n");
478 pr_err("FAIL: accessed page before stack! (byte: %x)\n", byte);
484 const unsigned char *stack = task_stack_page(current);
485 const unsigned char *ptr = stack + THREAD_SIZE;
488 pr_info("attempting bad read from page above current stack\n");
492 pr_err("FAIL: accessed page after stack! (byte: %x)\n", byte);
566 * Trigger #DF by setting the stack limit to zero. This clobbers
627 * stack pointer. As pac has fewer bits so there is a chance of