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] [day] [month] [year] [list]
Message-ID: <a7d9feaa-3a52-4c72-be56-6757e75af2ac@csgroup.eu>
Date: Sun, 9 Nov 2025 10:48:17 +0100
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Finn Thain <fthain@...ux-m68k.org>,
 Madhavan Srinivasan <maddy@...ux.ibm.com>,
 Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>
Cc: Cedar Maxwell <cedarmaxwell@....com>, Stan Johnson <userm57@...oo.com>,
 "Dr. David Alan Gilbert" <linux@...blig.org>,
 Benjamin Herrenschmidt <benh@...nel.crashing.org>, stable@...r.kernel.org,
 linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] powerpc: Use relocated font data pointer for
 btext_drawchar()



Le 09/11/2025 à 01:35, Finn Thain a écrit :
> From: Christophe Leroy <christophe.leroy@...roup.eu>
> 
> Since Linux v6.7, booting using BootX on an Old World PowerMac produces
> an early crash. Stan Johnson writes, "the symptoms are that the screen
> goes blank and the backlight stays on, and the system freezes (Linux
> doesn't boot)."
> Further testing revealed that the failure can be avoided by disabling
> CONFIG_BOOTX_TEXT. Bisection revealed that the regression was caused by
> a patch which replaced the static btext font data with const data in a
> different compilation unit. To fix this, access the font data at its
> relocated address.

You can explain that characters start being displayed by bootx_init() 
which is call very early in the boot before kernel text is relocated to 
its final location. During that period, data is addressed with an offset 
which is added to the Global Offset Table (GOT) entries at the start of 
bootx_init() by fonction reloc_got2(). But the pointers that are located 
inside a structure are not referenced in the GOT and are therefore not 
updated by reloc_got2(). It is therefore needed to apply the offset 
manually by using PTRRELOC() macro.

> 
> Cc: Cedar Maxwell <cedarmaxwell@....com>
> Cc: Stan Johnson <userm57@...oo.com>
> Cc: "Dr. David Alan Gilbert" <linux@...blig.org>
> Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
> Cc: stable@...r.kernel.org
> Link: https://lists.debian.org/debian-powerpc/2025/10/msg00111.html
> Link: https://lore.kernel.org/linuxppc-dev/d81ddca8-c5ee-d583-d579-02b19ed95301@yahoo.com/
> Reported-by: Cedar Maxwell <cedarmaxwell@....com>
> Closes: https://lists.debian.org/debian-powerpc/2025/09/msg00031.html
> Bisected-by: Stan Johnson <userm57@...oo.com>
> Tested-by: Stan Johnson <userm57@...oo.com>
> Fixes: 0ebc7feae79a ("powerpc: Use shared font data")
> Signed-off-by: Finn Thain <fthain@...ux-m68k.org>
> 
> ---
> 
> Christophe, as you're the author of this patch, this submission will
> probably need your sign-off.

I only suggested it, you authored the patch. Add me as:

Suggested-by: Christophe Leroy <christophe.leroy@...roup.eu>

> 
> ---
>   arch/powerpc/kernel/btext.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
> index 7f63f1cdc6c3..ca00c4824e31 100644
> --- a/arch/powerpc/kernel/btext.c
> +++ b/arch/powerpc/kernel/btext.c
> @@ -20,6 +20,7 @@
>   #include <asm/io.h>
>   #include <asm/processor.h>
>   #include <asm/udbg.h>
> +#include <asm/setup.h>
>   
>   #define NO_SCROLL
>   
> @@ -463,7 +464,7 @@ static noinline void draw_byte(unsigned char c, long locX, long locY)
>   {
>   	unsigned char *base	= calc_base(locX << 3, locY << 4);
>   	unsigned int font_index = c * 16;
> -	const unsigned char *font	= font_sun_8x16.data + font_index;
> +	const unsigned char *font = PTRRELOC(font_sun_8x16.data) + font_index;
>   	int rb			= dispDeviceRowBytes;
>   
>   	rmci_maybe_on();


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ