Re: task's thread_info print in kernel oops

From: Oleg Nesterov
Date: Sun Jul 13 2014 - 15:58:49 EST


On 07/14, Vaibhav Shinde wrote:
>
> During the kernel oops i observed the below debug message which shows the
> address of task's thread_info struct
>
> task: ffff880468e61a80 ti: ffff88026bc86000 task.ti: ffff88026bc86000
>
> ti: <current_thread_info()>
> task.ti <task_thread_info(current)
>
> As per my understanding, both the function calls will return the address of
> thread_info() struct of the current task,
> so it would be always the same.
>
> If so, could we apply the below change ?
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c

I too do not know, but perhaps this can help to detect that PER_CPU(kernel_stack)
or task->stack was corrupted.

> index b4e8500..904aeef 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -2902,9 +2902,8 @@ void show_regs_print_info(const char *log_lvl)
> {
> dump_stack_print_info(log_lvl);
>
> - printk("%stask: %p ti: %p task.ti: %p\n",
> - log_lvl, current, current_thread_info(),
> - task_thread_info(current));
> + printk("%stask: %p ti: %p\n",
> + log_lvl, current, current_thread_info());
> }
>
> #endif
>
>
>
> Thanks,
> Vaibhav

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/