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]
Message-ID: <130e31f0-ce38-77cb-58a9-cedf3b0f8113@siemens.com>
Date:   Wed, 30 Oct 2019 19:29:33 +0100
From:   Jan Kiszka <jan.kiszka@...mens.com>
To:     Ilya Leoshkevich <iii@...ux.ibm.com>,
        Kieran Bingham <kbingham@...nel.org>,
        linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Heiko Carstens <heiko.carstens@...ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>
Subject: Re: [PATCH] scripts/gdb: fix debugging modules compiled with hot/cold
 partitioning

On 28.10.19 16:27, Ilya Leoshkevich wrote:
> gcc's -freorder-blocks-and-partition option makes it group frequently
> and infrequently used code in .text.hot and .text.unlikely sections
> respectively. At least when building modules on s390, this option is
> used by default.
> 
> gdb assumes that all code is located in .text section, and that .text
> section is located at module load address. With such modules this is no
> longer the case: there is code in .text.hot and .text.unlikely, and
> either of them might precede .text.
> 
> Fix by explicitly telling gdb the addresses of code sections.
> 
> It might be tempting to do this for all sections, not only the ones in
> the white list. Unfortunately, gdb appears to have an issue, when telling
> it about e.g. loadable .note.gnu.build-id section causes it to think that
> non-loadable .note.Linux section is loaded at address 0, which in turn
> causes NULL pointers to be resolved to bogus symbols. So keep using the
> white list approach for the time being.

Did you report this to gdb?

> 
> Signed-off-by: Ilya Leoshkevich <iii@...ux.ibm.com>
> ---
>  scripts/gdb/linux/symbols.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
> index 7b7c2fafbc68..be984aa29b75 100644
> --- a/scripts/gdb/linux/symbols.py
> +++ b/scripts/gdb/linux/symbols.py
> @@ -99,7 +99,8 @@ lx-symbols command."""
>              attrs[n]['name'].string(): attrs[n]['address']
>              for n in range(int(sect_attrs['nsections']))}
>          args = []
> -        for section_name in [".data", ".data..read_mostly", ".rodata", ".bss"]:
> +        for section_name in [".data", ".data..read_mostly", ".rodata", ".bss",
> +                             ".text", ".text.hot", ".text.unlikely"]:
>              address = section_name_to_address.get(section_name)
>              if address:
>                  args.append(" -s {name} {addr}".format(
> 

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

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