kernel-debuginfokernel-source目录中存储了各内核版本对应的文件, 如下所示: /data/kernel-debuginfo/ ├── kernel-debuginfo-2.6.32-642.13.1.el6.x86_64 ├── kernel-debuginfo-3.10.0-862.14.4.el7.x86_64 ├── kernel-debuginfo-3.10.0-957.21.3.el7.x86_64 └── kernel-debuginfo-3.10.0-957....
__stack_chk_fail在内核中的实现是直接panic: __visible void __stack_chk_fail(void) { panic("stack-protector: Kernel stack is corrupted in: %pB\n", __builtin_return_address(0)); } EXPORT_SYMBOL(__stack_chk_fail); Deep Dive 最初的stack canary是如何设置的? 在内核初始化swapper进程的时...
show_fault_oops(regs, error_code, address); stackend = end_of_stack(tsk); if (*stackend != STACK_END_MAGIC) printk(KERN_ALERT "Thread overran stack, or stack corrupted\n"); tsk->thread.cr2 = address; tsk->thread.trap_no = 14; tsk->thread.error_code = error_code; sig = SIGKI...
show_fault_oops(regs, error_code, address); stackend = end_of_stack(tsk); if (*stackend != STACK_END_MAGIC) printk(KERN_ALERT"Thread overran stack, or stack corrupted\n"); tsk->thread.cr2 = address; tsk->thread.trap_no = 14; tsk->thread.error_code = error_code; sig = SIGKILL...
unsigned long *stackend; unsigned long flags; int sig; /* Are we prepared to handle this kernel fault? */ /*fixup_exception()用于搜索异常表,并试图找到一个对应该异常的例程来进行修正, 这个例程在fixup_exception()返回后执行*/ if (fixup_exception(regs)) ...
KernelStack: 23936 kB PageTables: 73880 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 25997672 kB Committed_AS: 24816804 kB VmallocTotal: 34359738367 kB VmallocUsed: 0 kB VmallocChunk: 0 kB Percpu: 3392 kB
staticnoinlinevoidno_context(struct pt_regs*regs,unsigned long error_code,unsigned long address){struct task_struct*tsk=current;unsigned long*stackend;unsigned long flags;int sig;/* Are we prepared to handle this kernel fault? *//*fixup_exception()用于搜索异常表,并试图找到一个对应该异常的例程...
faster - use long to make sure the buffer is aligned properly on 64 bit archs to avoid unaligned access */ /* * [1] stack_pps 256 字节的栈缓冲区, 负责存储前 30 个 pollfd entry */ longstack_pps[POLL_STACK_ALLOC/sizeof(long)]; ...
/* Unfortunately this kludge is needed for FIBMAP. Don't use it */int (*bmap)(struct address_space *, long);int (*flushpage) (struct page *, unsigned long);int (*releasepage) (struct page *, int);#define KERNEL_HAS_O_DIRECT /* this is for modules out of the kernel */int (...
unsignedlong *stackend; unsignedlong flags; int sig; /* Are we prepared to handle this kernel fault? */ /*fixup_exception()用于搜索异常表,并试图找到一个对应该异常的例程来进行修正, 这个例程在fixup_exception()返回后执行*/ if (fixup_exception(regs)) ...