Home
last modified time | relevance | path

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

12345678910>>...191

/kernel/linux/linux-6.6/include/linux/
Dstackdepot.h3 * Stack depot - a stack trace storage that avoids duplication.
5 * Stack depot is intended to be used by subsystems that need to store and
6 * later retrieve many potentially duplicated stack traces without wasting
9 * For example, KASAN needs to save allocation and free stack traces for each
10 * object. Storing two stack traces per object requires a lot of memory (e.g.
12 * stack traces often repeat, using stack depot allows to save about 100x space.
14 * Stack traces are never removed from the stack depot.
30 * Number of bits in the handle that stack depot doesn't use. Users may store
36 * Using stack depot requires its initialization, which can be done in 3 ways:
39 * scenarios where it's known at compile time that stack depot will be used.
[all …]
/kernel/uniproton/src/arch/cpu/armv8/common/
Dprt_port.c92 struct TskContext *stack = (struct TskContext *)((uintptr_t)topStack + stackSize); in OsTskContextInit() local
94 stack -= 1; in OsTskContextInit()
96 stack->x00 = 0; in OsTskContextInit()
97 stack->x01 = ARMV8_X1_INIT_VALUE; in OsTskContextInit()
98 stack->x02 = ARMV8_X2_INIT_VALUE; in OsTskContextInit()
99 stack->x03 = ARMV8_X3_INIT_VALUE; in OsTskContextInit()
100 stack->x04 = ARMV8_X4_INIT_VALUE; in OsTskContextInit()
101 stack->x05 = ARMV8_X5_INIT_VALUE; in OsTskContextInit()
102 stack->x06 = ARMV8_X6_INIT_VALUE; in OsTskContextInit()
103 stack->x07 = ARMV8_X7_INIT_VALUE; in OsTskContextInit()
[all …]
/kernel/linux/linux-6.6/Documentation/arch/x86/
Dshstk.rst4 Control-flow Enforcement Technology (CET) Shadow Stack
14 CET introduces shadow stack and indirect branch tracking (IBT). A shadow stack
15 is a secondary stack allocated from memory which cannot be directly modified by
17 return address to both the normal stack and the shadow stack. Upon
18 function return, the processor pops the shadow stack copy and compares it
19 to the normal stack copy. If the two differ, the processor raises a
22 Stack and Indirect Branch Tracking. Today in the 64-bit kernel, only userspace
23 shadow stack and kernel IBT are supported.
25 Requirements to use Shadow Stack
28 To use userspace shadow stack you need HW that supports it, a kernel
[all …]
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 …]
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/progs/
Dverifier_subprog_precision.c44 __msg("mark_precise: frame0: regs=r0 stack= before 6: (bf) r1 = r7")
45 __msg("mark_precise: frame0: regs=r0 stack= before 5: (27) r0 *= 4")
46 __msg("mark_precise: frame0: regs=r0 stack= before 11: (95) exit")
47 __msg("mark_precise: frame1: regs=r0 stack= before 10: (bf) r0 = r1")
48 __msg("mark_precise: frame1: regs=r1 stack= before 4: (85) call pc+5")
49 __msg("mark_precise: frame0: regs=r1 stack= before 3: (bf) r1 = r6")
50 __msg("mark_precise: frame0: regs=r6 stack= before 2: (b7) r6 = 3")
83 __msg("mark_precise: frame0: regs=r0 stack= before 8: (bf) r1 = r7")
84 __msg("mark_precise: frame0: regs=r0 stack= before 7: (27) r0 *= 4")
85 __msg("mark_precise: frame0: regs=r0 stack= before 5: (a5) if r0 < 0x4 goto pc+1")
[all …]
Dverifier_var_off.c36 __description("variable-offset stack read, priv vs unpriv")
38 __msg_unpriv("R2 variable stack access prohibited for !root")
43 /* Fill the top 8 bytes of the stack */ \ in stack_read_priv_vs_unpriv()
55 /* dereference it for a stack read */ \ in stack_read_priv_vs_unpriv()
63 __description("variable-offset stack read, uninitialized")
65 __failure_unpriv __msg_unpriv("R2 variable stack access prohibited for !root")
78 /* dereference it for a stack read */ \ in variable_offset_stack_read_uninitialized()
86 __description("variable-offset stack write, priv vs unpriv")
88 /* Check that the maximum stack depth is correctly maintained according to the
91 __log_level(4) __msg("stack depth 16")
[all …]
/kernel/linux/linux-5.10/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.c40 * On 64-bit, we have a generic entry stack that we in stack_type_name()
55 * @offs: Offset from the start of the exception stack area
56 * @size: Size of the exception stack
73 * Array of exception stack page descriptors. If the stack is larger than
74 * PAGE_SIZE, all pages covering a particular stack will have the same
75 * info. The guard pages including the not mapped DB2 stack are zeroed
88 static __always_inline bool in_exception_stack(unsigned long *stack, struct stack_info *info) in in_exception_stack() argument
90 unsigned long begin, end, stk = (unsigned long)stack; in in_exception_stack()
99 * Handle the case where stack trace is collected _before_ in in_exception_stack()
106 /* 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()
134 /* No access to the user space stack of other tasks. Ignore. */ in show_opcodes()
166 * ordering reasons: if the registers are on the next stack, we don't in show_regs_if_on_stack()
168 * the wrong stack. Later, when show_trace_log_lvl() switches to the in show_regs_if_on_stack()
169 * next stack, this function will be called again with the same regs so in show_regs_if_on_stack()
187 unsigned long *stack, const char *log_lvl) in show_trace_log_lvl() argument
197 unwind_start(&state, task, regs, stack); in show_trace_log_lvl()
[all …]
/kernel/linux/linux-6.6/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 …]
/kernel/linux/linux-5.10/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 long_tmp = stack[stack_ptr - 2]; in altera_execute()
535 stack[stack_ptr - 2] = stack[stack_ptr - 1]; in altera_execute()
536 stack[stack_ptr - 1] = long_tmp; in altera_execute()
542 stack[stack_ptr - 1] += stack[stack_ptr]; in altera_execute()
548 stack[stack_ptr - 1] -= stack[stack_ptr]; in altera_execute()
554 stack[stack_ptr - 1] *= stack[stack_ptr]; in altera_execute()
560 stack[stack_ptr - 1] /= stack[stack_ptr]; in altera_execute()
[all …]
/kernel/linux/linux-5.10/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 …]
/kernel/linux/linux-6.6/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 …]
/kernel/linux/linux-6.6/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()
113 unsigned long *stack = check_init_stack(mm_idp, *addr); in run_syscall_stub() local
[all …]
/kernel/linux/linux-5.10/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()
74 * beginning of the stack: in do_syscall_stub()
78 ret = *((unsigned long *) mm_idp->stack); in do_syscall_stub()
79 offset = *((unsigned long *) mm_idp->stack + 1); in do_syscall_stub()
81 data = (unsigned long *)(mm_idp->stack + offset - STUB_DATA); in do_syscall_stub()
114 unsigned long *stack = check_init_stack(mm_idp, *addr); in run_syscall_stub() local
[all …]
/kernel/linux/linux-5.10/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
68 Zero-initialize any structures on the stack containing
70 uninitialized stack variable exploits and information
80 Zero-initialize any structures on the stack that may
83 of uninitialized stack variable exploits and information
[all …]
/kernel/linux/linux-6.6/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 …]
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/verifier/
Dprecise.c42 mark_precise: frame0: regs=r2 stack= before 25\
43 mark_precise: frame0: regs=r2 stack= before 24\
44 mark_precise: frame0: regs=r2 stack= before 23\
45 mark_precise: frame0: regs=r2 stack= before 22\
46 mark_precise: frame0: regs=r2 stack= before 20\
47 mark_precise: frame0: parent state regs=r2 stack=:\
49 mark_precise: frame0: regs=r2,r9 stack= before 19\
50 mark_precise: frame0: regs=r9 stack= before 18\
51 mark_precise: frame0: regs=r8,r9 stack= before 17\
52 mark_precise: frame0: regs=r0,r9 stack= before 15\
[all …]
/kernel/linux/linux-5.10/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 …]
/kernel/linux/linux-6.6/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 …]
/kernel/linux/linux-6.6/lib/
Dstackdepot.c3 * Stack depot - a stack trace storage that avoids duplication.
5 * Internally, stack depot maintains a hash table of unique stacktraces. The
6 * stack traces themselves are stored contiguously one after another in a set
47 /* Compact structure that stores a reference to a stack. */
78 /* Hash table of pointers to stored stack traces. */
85 /* Array of memory regions that store stack traces. */
94 * Stack depot tries to keep an extra pool allocated even before it runs out
136 * stack traces being stored in stack depot. in stack_depot_early_init()
221 /* Uses preallocated memory to initialize a new stack depot pool. */
258 /* Allocates a new stack in a stack depot pool. */
[all …]
/kernel/linux/linux-5.10/arch/x86/entry/
Dentry_32.S7 * Stack layout while running C code:
8 * ptrace needs to have all registers on the stack.
59 * %gs is used for userland TLS and kernel only uses it for stack
200 * When we're here from kernel mode; the (exception) stack looks like:
248 * so any attempt to access the stack needs to use SS. (except for
257 * middle doesn't scribble our stack.
313 /* Switch to kernel stack if necessary */
409 * Setup and switch to ESPFIX stack
411 * We're returning to userspace with a 16 bit stack. The CPU will not
445 * entry-stack, it will overwrite the task-stack and everything we
[all …]

12345678910>>...191