]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - arch/x86/kernel/irq_64.c
x86_64: fix the check in stack_overflow_check
[mirror_ubuntu-zesty-kernel.git] / arch / x86 / kernel / irq_64.c
index 60eb84eb77a0a34232be8aafbe8a7d1e040f454f..b842fc82be15a079f5a9268fcddcc222cf41ccfc 100644 (file)
 static inline void stack_overflow_check(struct pt_regs *regs)
 {
        u64 curbase = (u64)task_stack_page(current);
-       static unsigned long warned = -60*HZ;
+       static unsigned long warned = INITIAL_JIFFIES - 60*HZ;
 
        if (regs->sp >= curbase && regs->sp <= curbase + THREAD_SIZE &&
-           regs->sp <  curbase + sizeof(struct thread_info) + 128 &&
-           time_after(jiffies, warned + 60*HZ)) {
+                       regs->sp < curbase + sizeof(struct thread_info) +
+                       sizeof(struct pt_regs) + 128 &&
+                       time_after(jiffies, warned + 60*HZ)) {
                printk("do_IRQ: %s near stack overflow (cur:%Lx,sp:%lx)\n",
                       current->comm, curbase, regs->sp);
                show_stack(NULL,NULL);