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:   Tue, 25 Jul 2023 12:33:41 +0200
From:   Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To:     James Clark <james.clark@....com>
Cc:     linux-kbuild@...r.kernel.org, masahiroy@...nel.org,
        linux-kernel@...r.kernel.org, Kees Cook <keescook@...omium.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Zhen Lei <thunder.leizhen@...wei.com>,
        Miguel Ojeda <ojeda@...nel.org>,
        Boqun Feng <boqun.feng@...il.com>,
        Arnd Bergmann <arnd@...db.de>, Nicolas Schier <n.schier@....de>
Subject: Re: [PATCH] scripts/kallsyms: Fix build failure by setting errno
 before calling getline()

On Tue, Jul 25, 2023 at 10:55 AM James Clark <james.clark@....com> wrote:
>
> But I just checked now and it's just bear [1] that causes the issue.
> Maybe it sets errno before forking and that persists in the child
> processes? Not 100% sure how it works. I did debug scripts/kallsyms and
> errno was already set on the first line of main(), so it's not some
> other library call in kallsyms that is setting it but not being checked.

I think this is https://github.com/rizsotto/Bear/issues/469: bear
preloads a library which was setting it to non-zero.

Now, even if bear was breaking a guarantee C programs have (`errno`
for the initial thread at program startup is meant to be 0 according
to the C standard), it is still a good idea to set `errno` to zero
here in case something else happens to change `errno` within
`kallsyms` in the future.

With the repro and the `bear` link issue added:

    Reviewed-by: Miguel Ojeda <ojeda@...nel.org>

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ