Home
last modified time | relevance | path

Searched full:stack (Results 1 – 25 of 2711) sorted by relevance

12345678910>>...109

/Linux-v6.1/arch/x86/kernel/
Ddumpstack_32.c38 static bool in_hardirq_stack(unsigned long *stack, struct stack_info *info) in in_hardirq_stack() argument
44 * This is a software stack, so 'end' can be a valid stack pointer. in in_hardirq_stack()
45 * It just means the stack is empty. in in_hardirq_stack()
47 if (stack < begin || stack > end) in in_hardirq_stack()
55 * See irq_32.c -- the next stack pointer is stored at the beginning of in in_hardirq_stack()
56 * the stack. in in_hardirq_stack()
63 static bool in_softirq_stack(unsigned long *stack, struct stack_info *info) in in_softirq_stack() argument
69 * This is a software stack, so 'end' can be a valid stack pointer. in in_softirq_stack()
70 * It just means the stack is empty. in in_softirq_stack()
72 if (stack < begin || stack > end) in in_softirq_stack()
[all …]
Ddumpstack_64.c46 * On 64-bit, we have a generic entry stack that we in stack_type_name()
61 * @offs: Offset from the start of the exception stack area
62 * @size: Size of the exception stack
79 * Array of exception stack page descriptors. If the stack is larger than
80 * PAGE_SIZE, all pages covering a particular stack will have the same
81 * info. The guard pages including the not mapped DB2 stack are zeroed
94 static __always_inline bool in_exception_stack(unsigned long *stack, struct stack_info *info) in in_exception_stack() argument
96 unsigned long begin, end, stk = (unsigned long)stack; in in_exception_stack()
105 * Handle the case where stack trace is collected _before_ in in_exception_stack()
112 /* Bail if @stack is outside the exception stack area. */ in in_exception_stack()
[all …]
Ddumpstack.c32 bool noinstr in_task_stack(unsigned long *stack, struct task_struct *task, in in_task_stack() argument
38 if (stack < begin || stack >= end) in in_task_stack()
50 bool noinstr in_entry_stack(unsigned long *stack, struct stack_info *info) in in_entry_stack() argument
57 if ((void *)stack < begin || (void *)stack >= end) in in_entry_stack()
128 /* No access to the user space stack of other tasks. Ignore. */ in show_opcodes()
160 * ordering reasons: if the registers are on the next stack, we don't in show_regs_if_on_stack()
162 * the wrong stack. Later, when show_trace_log_lvl() switches to the in show_regs_if_on_stack()
163 * next stack, this function will be called again with the same regs so in show_regs_if_on_stack()
181 * This function reads pointers from the stack and dereferences them. The
187 unsigned long *stack, const char *log_lvl) in show_trace_log_lvl() argument
[all …]
/Linux-v6.1/drivers/misc/altera-stapl/
Daltera.c119 /* This function checks if enough parameters are available on the stack. */
213 long *stack = astate->stack; in altera_execute() local
528 stack[stack_ptr] = stack[stack_ptr - 1]; in altera_execute()
534 swap(stack[stack_ptr - 2], stack[stack_ptr - 1]); in altera_execute()
539 stack[stack_ptr - 1] += stack[stack_ptr]; in altera_execute()
545 stack[stack_ptr - 1] -= stack[stack_ptr]; in altera_execute()
551 stack[stack_ptr - 1] *= stack[stack_ptr]; in altera_execute()
557 stack[stack_ptr - 1] /= stack[stack_ptr]; in altera_execute()
563 stack[stack_ptr - 1] %= stack[stack_ptr]; in altera_execute()
569 stack[stack_ptr - 1] <<= stack[stack_ptr]; in altera_execute()
[all …]
/Linux-v6.1/tools/testing/selftests/bpf/verifier/
Dprecise.c43 regs=4 stack=0 before 25\
44 regs=4 stack=0 before 24\
45 regs=4 stack=0 before 23\
46 regs=4 stack=0 before 22\
47 regs=4 stack=0 before 20\
48 parent didn't have regs=4 stack=0 marks\
50 regs=4 stack=0 before 19\
51 regs=200 stack=0 before 18\
52 regs=300 stack=0 before 17\
53 regs=201 stack=0 before 15\
[all …]
Dvar_off.c21 "variable-offset stack read, priv vs unpriv",
23 /* Fill the top 8 bytes of the stack */
34 /* dereference it for a stack read */
41 .errstr_unpriv = "R2 variable stack access prohibited for !root",
45 "variable-offset stack read, uninitialized",
56 /* dereference it for a stack read */
62 .errstr = "invalid variable-offset read from stack R2",
66 "variable-offset stack write, priv vs unpriv",
77 /* Dereference it for a stack write */
89 /* Variable stack access is rejected for unprivileged.
[all …]
/Linux-v6.1/arch/um/os-Linux/skas/
Dmem.c26 unsigned long *stack) in check_init_stack() argument
28 if (stack == NULL) { in check_init_stack()
29 stack = (unsigned long *) mm_idp->stack + 2; in check_init_stack()
30 *stack = 0; in check_init_stack()
32 return stack; in check_init_stack()
76 * beginning of the stack: in do_syscall_stub()
80 ret = *((unsigned long *) mm_idp->stack); in do_syscall_stub()
81 offset = *((unsigned long *) mm_idp->stack + 1); in do_syscall_stub()
83 data = (unsigned long *)(mm_idp->stack + offset - STUB_DATA); in do_syscall_stub()
116 unsigned long *stack = check_init_stack(mm_idp, *addr); in run_syscall_stub() local
[all …]
/Linux-v6.1/lib/
Dstackdepot.c3 * Generic stack depot for storing stack traces.
5 * Some debugging tools need to save stack traces of certain events which can
7 * free stacks for each object, but storing two stack traces per object
11 * Instead, stack depot maintains a hashtable of unique stacktraces. Since alloc
40 #define STACK_ALLOC_ORDER 2 /* 'Slab' size order for stack depot, 4 pages */
67 u32 size; /* Number of frames in the stack */
118 /* Allocation of a new stack in raw storage */
122 struct stack_record *stack; in depot_alloc_stack() local
123 size_t required_size = struct_size(stack, entries, size); in depot_alloc_stack()
129 WARN_ONCE(1, "Stack depot reached limit capacity"); in depot_alloc_stack()
[all …]
/Linux-v6.1/Documentation/mm/
Dvmalloced-kernel-stacks.rst4 Virtually Mapped Kernel Stack Support
21 Kernel stack overflows are often hard to debug and make the kernel
25 Virtually-mapped kernel stacks with guard pages causes kernel stack
31 causes reliable faults when the stack overflows. The usability of
32 the stack trace after overflow and response to the overflow itself
49 needs to work while the stack points to a virtual address with
51 most likely) needs to ensure that the stack's page table entries
52 are populated before running on a possibly unpopulated stack.
53 - If the stack overflows into a guard page, something reasonable
64 with guard pages. This causes kernel stack overflows to be caught
[all …]
/Linux-v6.1/Documentation/x86/
Dkernel-stacks.rst14 Like all other architectures, x86_64 has a kernel stack for every
17 zombie. While the thread is in user space the kernel stack is empty
25 * Interrupt stack. IRQ_STACK_SIZE
29 kernel switches from the current task to the interrupt stack. Like
32 of every per thread stack.
34 The interrupt stack is also used when processing a softirq.
36 Switching to the kernel interrupt stack is done by software based on a
41 to automatically switch to a new stack for designated events such as
43 events on x86_64. This feature is called the Interrupt Stack Table
46 point to dedicated stacks; each stack can be a different size.
[all …]
/Linux-v6.1/arch/x86/entry/
Dentry_32.S7 * Stack layout while running C code:
8 * ptrace needs to have all registers on the stack.
123 * When we're here from kernel mode; the (exception) stack looks like:
171 * so any attempt to access the stack needs to use SS. (except for
180 * middle doesn't scribble our stack.
233 /* Switch to kernel stack if necessary */
325 * Setup and switch to ESPFIX stack
327 * We're returning to userspace with a 16 bit stack. The CPU will not
361 * entry-stack, it will overwrite the task-stack and everything we
362 * copied there. So allocate the stack-frame on the task-stack and
[all …]
Dentry_64.S15 * at the top of the kernel process stack.
65 * are not needed). SYSCALL does not save anything on the stack
100 /* Construct struct pt_regs on stack */
204 * Save old stack pointer and switch to trampoline stack.
214 * We are on the trampoline stack. All regs except RDI are live.
249 /* switch stack */
259 * When switching from a shallower to a deeper call stack
340 * @has_error_code: Hardware pushed error code on stack
345 * Call error_entry() and switch to the task stack if from userspace.
347 * When in XENPV, it is already in the task stack, and it can't fault
[all …]
/Linux-v6.1/kernel/
Dstackleak.c3 * This code fills the used part of the kernel stack with a poison value
9 * STACKLEAK reduces the information which kernel stack leak bugs can
10 * reveal and blocks some uninitialized stack variable attacks.
43 pr_warn("stackleak: kernel stack erasing is %s\n", in stack_erasing_sysctl()
87 * Write poison to the task's stack between 'erase_low' and in __stackleak_erase()
90 * If we're running on a different stack (e.g. an entry trampoline in __stackleak_erase()
91 * stack) we can erase everything below the pt_regs at the top of the in __stackleak_erase()
92 * task stack. in __stackleak_erase()
94 * If we're running on the task stack itself, we must not clobber any in __stackleak_erase()
95 * stack used by this function and its caller. We assume that this in __stackleak_erase()
[all …]
Dstacktrace.c5 * Stack trace management functions
19 * stack_trace_print - Print the entries in the stack trace
38 * stack_trace_snprint - Print the entries in the stack trace into a buffer
105 * stack_trace_save - Save a stack trace into a storage array
108 * @skipnr: Number of entries to skip at the start of the stack trace
128 * stack_trace_save_tsk - Save a task stack trace into a storage array
132 * @skipnr: Number of entries to skip at the start of the stack trace
156 * stack_trace_save_regs - Save a stack trace based on pt_regs into a storage array
160 * @skipnr: Number of entries to skip at the start of the stack trace
180 * stack_trace_save_tsk_reliable - Save task stack with verification
[all …]
/Linux-v6.1/drivers/misc/lkdtm/
Dstackleak.c3 * This code tests that the current task stack is properly erased (filled
16 * Check that stackleak tracks the lowest stack pointer and erases the stack
19 * To prevent the lowest stack pointer changing during the test, IRQs are
21 * compiler will create a fixed-size stack frame for this function.
23 * Any non-inlined function may make further use of the stack, altering the
24 * lowest stack pointer and/or clobbering poison values. To avoid spurious
40 * Check that the current and lowest recorded stack pointer values fall in check_stackleak_irqoff()
41 * within the expected task stack boundaries. These tests should never in check_stackleak_irqoff()
46 pr_err("FAIL: current_stack_pointer (0x%lx) outside of task stack bounds [0x%lx..0x%lx]\n", in check_stackleak_irqoff()
52 pr_err("FAIL: current->lowest_stack (0x%lx) outside of task stack bounds [0x%lx..0x%lx]\n", in check_stackleak_irqoff()
[all …]
/Linux-v6.1/security/
DKconfig.hardening8 stack variable initializations, this warning is silenced for
38 prompt "Initialize kernel stack variables at function entry"
44 This option enables initialization of stack variables at
56 bool "no automatic stack variable initialization (weakest)"
58 Disable automatic stack variable initialization.
60 classes of uninitialized stack variable exploits
69 Zero-initialize any structures on the stack containing
71 uninitialized stack variable exploits and information
82 Zero-initialize any structures on the stack that may
85 of uninitialized stack variable exploits and information
[all …]
/Linux-v6.1/arch/openrisc/kernel/
Dunwinder.c28 * the frame pointer should point to a location in the stack after the
40 * Create a stack trace doing scanning which is frame pointer aware. We can
41 * get reliable stack traces by matching the previously found frame
42 * pointer with the top of the stack address every time we find a valid
45 * Ideally the stack parameter will be passed as FP, but it can not be
49 * The OpenRISC stack frame looks something like the following. The
53 * SP -> (top of stack)
58 * FP -> (previous top of stack) /
60 void unwind_stack(void *data, unsigned long *stack, in unwind_stack() argument
67 while (!kstack_end(stack)) { in unwind_stack()
[all …]
/Linux-v6.1/kernel/trace/
Dtrace_stack.c58 * The stack tracer looks for a maximum stack at each call from a function. It
59 * registers a callback from ftrace, and in that callback it examines the stack
60 * size. It determines the stack size from the variable passed in, which is the
62 * The stack size is calculated by the address of the local variable to the top
63 * of the current stack. If that size is smaller than the currently saved max
64 * stack size, nothing more is done.
66 * If the size of the stack is greater than the maximum recorded size, then the
70 * saving the function's local variables, the stack will look something like
73 * [ top of stack ]
80 * 31: [ do trace stack here ]
[all …]
/Linux-v6.1/include/linux/sched/
Dtask_stack.h6 * task->stack (kernel stack) handling interfaces:
15 * When accessing the stack of a non-current task that might exit, use
21 return task->stack; in task_stack_page()
29 return (unsigned long *)((unsigned long)task->stack + THREAD_SIZE) - 1; in end_of_stack()
31 return task->stack; in end_of_stack()
37 #define task_stack_page(task) ((void *)(task)->stack)
46 * Return the address of the last usable long on the stack.
48 * When the stack grows down, this is just above the thread
51 * When the stack grows up, this is the highest address.
89 void *stack = task_stack_page(current); in object_is_on_stack() local
[all …]
/Linux-v6.1/tools/lib/traceevent/plugins/
Dplugin_function.c15 char **stack; member
53 static void add_child(struct func_stack *stack, const char *child, int pos) in add_child() argument
60 if (pos < stack->size) in add_child()
61 free(stack->stack[pos]); in add_child()
65 ptr = realloc(stack->stack, sizeof(char *) * in add_child()
66 (stack->size + STK_BLK)); in add_child()
72 stack->stack = ptr; in add_child()
74 for (i = stack->size; i < stack->size + STK_BLK; i++) in add_child()
75 stack->stack[i] = NULL; in add_child()
76 stack->size += STK_BLK; in add_child()
[all …]
/Linux-v6.1/arch/arm64/include/asm/stacktrace/
Dcommon.h3 * Common arm64 stack unwinder code.
32 * @stack: The stack currently being unwound.
44 struct stack_info stack; member
77 state->stack = stackinfo_get_unknown(); in unwind_init_common()
95 * unwind_consume_stack() - Check if an object is on an accessible stack,
96 * updating stack boundaries so that future unwind steps cannot consume this
111 if (stackinfo_on_stack(&state->stack, sp, size)) in unwind_consume_stack()
119 * Stack transitions are strictly one-way, and once we've in unwind_consume_stack()
120 * transitioned from one stack to another, it's never valid to in unwind_consume_stack()
121 * unwind back to the old stack. in unwind_consume_stack()
[all …]
/Linux-v6.1/arch/x86/include/asm/
Dirq_stack.h13 * Macro to inline switching to an interrupt stack and invoking function
18 * 1. Write the stack pointer into the top most place of the irq
19 * stack. This ensures that the various unwinders can link back to the
20 * original stack.
22 * 2. Switch the stack pointer to the top of the irq stack.
26 * 4. Pop the original stack pointer from the top of the irq stack
27 * which brings it back to the original stack where it left off.
38 * The @tos variable holds a pointer to the top of the irq stack and
45 * stack pointer is used again afterwards
81 #define call_on_stack(stack, func, asm_call, argconstr...) \ argument
[all …]
/Linux-v6.1/arch/m68k/68000/
Dentry.S96 /* kernel stack, otherwise stack overflow can occur during*/
132 movel #65,%sp@- /* put vector # on stack*/
134 3: addql #8,%sp /* pop parameters off stack*/
143 movel #66,%sp@- /* put vector # on stack*/
145 3: addql #8,%sp /* pop parameters off stack*/
154 movel #67,%sp@- /* put vector # on stack*/
156 3: addql #8,%sp /* pop parameters off stack*/
165 movel #68,%sp@- /* put vector # on stack*/
167 3: addql #8,%sp /* pop parameters off stack*/
176 movel #69,%sp@- /* put vector # on stack*/
[all …]
/Linux-v6.1/fs/ocfs2/
Dstackglue.h5 * Glue to the underlying cluster stack.
89 * state for the underlying stack. ocfs2 does use cc_version to determine
106 * Each cluster stack implements the stack operations structure. Not used
108 * into stack operations.
113 * filesystem to the cluster stack. The ->connect() op is passed
117 * The stack must set up any notification mechanisms and create
134 * fs code. The stack must disengage from the DLM and discontinue
138 * be freed. Thus, a stack must not return from ->disconnect()
141 * Once this call returns, the stack glue will be dropping this
158 * stack will likely want to wrap ast and bast calls before passing
[all …]
/Linux-v6.1/mm/
Dusercopy.c28 * stack frame (if possible).
31 * NOT_STACK: not at all on the stack
32 * GOOD_FRAME: fully within a valid stack frame
33 * GOOD_STACK: within the current stack (when can't frame-check exactly)
34 * BAD_STACK: error condition (invalid stack position or bad stack frame)
38 const void * const stack = task_stack_page(current); in check_stack_object() local
39 const void * const stackend = stack + THREAD_SIZE; in check_stack_object()
42 /* Object is not on the stack at all. */ in check_stack_object()
43 if (obj + len <= stack || stackend <= obj) in check_stack_object()
47 * Reject: object partially overlaps the stack (passing the in check_stack_object()
[all …]

12345678910>>...109