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: <7e1c9df5-d334-461d-56fc-53625c6ca163@roeck-us.net>
Date:   Wed, 5 Aug 2020 12:24:46 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     Naresh Kamboju <naresh.kamboju@...aro.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Marc Zyngier <maz@...nel.org>,
        open list <linux-kernel@...r.kernel.org>,
        Shuah Khan <shuah@...nel.org>, patches@...nelci.org,
        lkft-triage@...ts.linaro.org,
        Ben Hutchings <ben.hutchings@...ethink.co.uk>,
        linux- stable <stable@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Willy Tarreau <w@....eu>,
        Grygorii Strashko <grygorii.strashko@...com>
Subject: Re: [PATCH 5.7 0/6] 5.7.14-rc1 review

On 8/5/20 11:37 AM, Linus Torvalds wrote:
> On Wed, Aug 5, 2020 at 11:24 AM Guenter Roeck <linux@...ck-us.net> wrote:
>>
>> Same with older versions of gcc. I don't see the problem with the
>> mainline kernel.
> 
>   https://www.youtube.com/watch?v=-b5aW08ivHU
> 
>> I think this is caused by more recursive includes.
>> arch/arm64/include/asm/archrandom.h includes include/linux/random.h
>> which includes arch/arm64/include/asm/archrandom.h to get the definition
>> of arch_get_random_seed_long_early (which it won't get because of
>> the recursion).
>>
>> What I don't really understand is how this works with new versions
>> of gcc.
> 
> Is that the only place it triggers?
> 
> Because the trivial fix would be something like the appended, which is
> the right thing to do anyway.
> 

Correct.

gcc-7.x and older don't support CONFIG_ARM64_PTR_AUTH. Result is that
./arch/arm64/include/asm/pointer_auth.h doesn't include <linux/random.h>
for those compiler versions, which results in the problem.

In the mainline kernel, ./arch/arm64/include/asm/pointer_auth.h
always includes <linux/random.h>, so the problem isn't seen (or, rather,
it is hidden) there.

The problem is caused (exposed) by Marc's commit ("arm64: Workaround
circular dependency in pointer_auth.h"), which makes the include of
linux/random.h conditional.

Guenter

>               Linus
> 
> diff --git a/arch/arm64/kernel/kaslr.c b/arch/arm64/kernel/kaslr.c
> index 07c4c8cc4a67..9ded4237e1c1 100644
> --- a/arch/arm64/kernel/kaslr.c
> +++ b/arch/arm64/kernel/kaslr.c
> @@ -11,8 +11,8 @@
>  #include <linux/sched.h>
>  #include <linux/types.h>
>  #include <linux/pgtable.h>
> +#include <linux/random.h>
> 
> -#include <asm/archrandom.h>
>  #include <asm/cacheflush.h>
>  #include <asm/fixmap.h>
>  #include <asm/kernel-pgtable.h>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ