lkml.org 
[lkml]   [2016]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 08/44] x86/dumpstack: fix irq stack bounds calculation in show_stack_log_lvl()
    Date
    The percpu irq_stack_ptr variable has a 64-byte gap from the end of the
    allocated irq stack area, so subtracting IRQ_STACK_SIZE from it actually
    results in a value 64 bytes before the beginning of the stack. Use
    IRQ_USABLE_STACK_SIZE instead.

    Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
    ---
    arch/x86/kernel/dumpstack_64.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
    index 7ea6ed0..0fdd371 100644
    --- a/arch/x86/kernel/dumpstack_64.c
    +++ b/arch/x86/kernel/dumpstack_64.c
    @@ -253,8 +253,8 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
    preempt_disable();
    cpu = smp_processor_id();

    - irq_stack_end = (unsigned long *)(per_cpu(irq_stack_ptr, cpu));
    - irq_stack = (unsigned long *)(per_cpu(irq_stack_ptr, cpu) - IRQ_STACK_SIZE);
    + irq_stack_end = (unsigned long *)(per_cpu(irq_stack_ptr, cpu));
    + irq_stack = irq_stack_end - (IRQ_USABLE_STACK_SIZE / sizeof(long));

    /*
    * Debugging aid: "show_stack(NULL, NULL);" prints the
    --
    2.7.4
    \
     
     \ /
      Last update: 2016-08-05 01:01    [W:3.460 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site