lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 18 Jan 2018 16:43:56 +0100
From:   Jan Kiszka <jan.kiszka@...mens.com>
To:     Xi Kangjie <imxikangjie@...il.com>, kieran@...uared.org.uk,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scripts/gdb: fix get_thread_info

On 2018-01-18 22:01, Xi Kangjie wrote:
> Since kernel 4.9, the thread_info has been moved into task_struct,
> no longer locates at the bottom of kernel stack.
> 
> See commits:
> - commit c65eacbe290b ("sched/core: Allow putting thread_info into
> task_struct")
> - commit 15f4eae70d36 ("x86: Move thread_info into task_struct")
> 
> Before fix:
> (gdb) set $current = $lx_current()
> (gdb) p $lx_thread_info($current)
> $1 = {flags = 1470918301}
> (gdb) p $current.thread_info
> $2 = {flags = 2147483648}
> 
> After fix:
> (gdb) p $lx_thread_info($current)
> $1 = {flags = 2147483648}
> (gdb) p $current.thread_info
> $2 = {flags = 2147483648}
> 
> Signed-off-by: Xi Kangjie <imxikangjie@...il.com>
> ---
>  scripts/gdb/linux/tasks.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py
> index 1bf949c43b76..f6ab3ccf698f 100644
> --- a/scripts/gdb/linux/tasks.py
> +++ b/scripts/gdb/linux/tasks.py
> @@ -96,6 +96,8 @@ def get_thread_info(task):
>          thread_info_addr = task.address + ia64_task_size
>          thread_info = thread_info_addr.cast(thread_info_ptr_type)
>      else:
> +        if task.type.fields()[0].type == thread_info_type.get_type():
> +            return task['thread_info']
>          thread_info = task['stack'].cast(thread_info_ptr_type)
>      return thread_info.dereference()
>  
> 

Acked-by: Jan Kiszka <jan.kiszka@...mens.com>

Andrew, please pick up.

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ