On Thu, Oct 03, 2024 at 01:12:59PM -0400, Jason Montleon wrote: > On Thu, Oct 3, 2024 at 10:41 AM Alexandre Ghiti <[email protected]> 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.
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! :) -Kees -- Kees Cook
