Lines Matching defs:stack

29  * Make sure our attempts to over run the kernel stack doesn't trigger
45 * Make sure compiler does not optimize this function or stack frame away:
47 * - stack variables are marked volatile
48 * - stack variables are written (memset()) and read (buf[..] passed as arg)
188 pr_info("FAIL: survived without exhausting stack?!\n");
191 static noinline void __lkdtm_CORRUPT_STACK(void *stack)
193 memset(stack, '\xff', 64);
196 /* This should trip the stack canary, not corrupt the return address. */
199 /* Use default char array length that triggers stack protection. */
202 pr_info("Corrupting stack containing char array ...\n");
214 pr_info("Corrupting stack containing union ...\n");
227 pr_info("Starting stack offset tracking for pid %d\n", pid);
239 static noinline void __lkdtm_REPORT_STACK_CANARY(void *stack)
243 unsigned long *canary = (unsigned long *)stack;
248 canary = (unsigned long *)stack + i;
260 * we're either using a global canary or the stack frame
264 pr_err("FAIL: global stack canary found at offset %ld (canary for pid %d matches init_task's)!\n",
267 pr_warn("FAIL: did not correctly locate stack canary :(\n");
276 canary = (unsigned long *)stack + current_offset;
281 pr_info("Recorded stack canary for pid %d at offset %ld\n",
296 pr_info("ok: stack canaries differ between pid %d and pid %d at offset %ld.\n",
306 /* Use default char array length that triggers stack protection. */
652 const unsigned char *stack = task_stack_page(current);
653 const unsigned char *ptr = stack - 1;
656 pr_info("attempting bad read from page below current stack\n");
660 pr_err("FAIL: accessed page before stack! (byte: %x)\n", byte);
666 const unsigned char *stack = task_stack_page(current);
667 const unsigned char *ptr = stack + THREAD_SIZE;
670 pr_info("attempting bad read from page above current stack\n");
674 pr_err("FAIL: accessed page after stack! (byte: %x)\n", byte);
748 * Trigger #DF by setting the stack limit to zero. This clobbers
809 * stack pointer. As pac has fewer bits so there is a chance of