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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 25 Jul 2023 12:00:32 +0100
From:   James Clark <james.clark@....com>
To:     Miguel Ojeda <miguel.ojeda.sandonis@...il.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 25/07/2023 11:33, Miguel Ojeda wrote:
> 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

Oh yeah nice find, that's the issue. I added it and sent a v2.

Thanks
James

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ