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: <0c9371f2-e8e9-479f-856d-408a81213747@ghiti.fr>
Date: Fri, 4 Oct 2024 13:37:44 +0200
From: Alexandre Ghiti <alex@...ti.fr>
To: Kees Cook <kees@...nel.org>, Jason Montleon <jmontleo@...hat.com>
Cc: linux-hardening@...r.kernel.org,
 Linux regressions mailing list <regressions@...ts.linux.dev>,
 linux-riscv@...ts.infradead.org
Subject: Re: [REGRESSION][BISECTED] Cannot boot Lichee Pi 4A with
 FORTIFY_SOURCE enabled

Hi Kees, Jason,

On 03/10/2024 23:21, Kees Cook wrote:
> On Thu, Oct 03, 2024 at 01:12:59PM -0400, Jason Montleon wrote:
>> On Thu, Oct 3, 2024 at 10:41 AM Alexandre Ghiti <alex@...ti.fr> wrote:
>>> So I was able to reproduce the issue on qemu by adding a few tweaks, and
>>> indeed we trap in __warn_printk() on a virtual address but MMU is not
>>> enabled yet.
>>>
>>> The following diff though allows me to pass this failure but I can't get
>>> much further in the boot since the tweaks I added won't allow it, can
>>> you give the following a try?
>>>
>>> diff --git a/arch/riscv/errata/Makefile b/arch/riscv/errata/Makefile
>>> index 8a27394851233..4913f3b3f198c 100644
>>> --- a/arch/riscv/errata/Makefile
>>> +++ b/arch/riscv/errata/Makefile
>>> @@ -2,6 +2,10 @@ ifdef CONFIG_RELOCATABLE
>>>    KBUILD_CFLAGS += -fno-pie
>>>    endif
>>>
>>> +ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
>>> +KBUILD_CFLAGS += -D__NO_FORTIFY
>>> +endif
>>> +
>>>    obj-$(CONFIG_ERRATA_ANDES) += andes/
>>>    obj-$(CONFIG_ERRATA_SIFIVE) += sifive/
>>>    obj-$(CONFIG_ERRATA_THEAD) += thead/
>> Yes, this worked.


Great; thanks!


> Thanks for testing!
>
> Yeah, this matches similar fortify disabling in other early boot areas.
> Usually it's part of a common header, but setting it via the Makefile
> also works. I'll leave it up to the riscv maintainers! :)


I found a few other spots where we did not disable fortify, the easiest 
path I found was indeed to do that in the Makefile.

I have a question though: should we do something about the following 
warnings? Is there something wrong somewhere?

Wanted to write 8 to a 0-sized destination: oldptr at 
arch/riscv/errata/thead/errata.c:185
Wanted to write 28 to a 0-sized destination: oldptr at 
arch/riscv/errata/thead/errata.c:185

Thanks,

Alex


>
> -Kees
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ