Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230211193044.GM4163@brightrain.aerifal.cx>
Date: Sat, 11 Feb 2023 14:30:44 -0500
From: Rich Felker <dalias@...c.org>
To: Bastian Bittorf <bb@....de>
Cc: musl@...ts.openwall.com, mailinglist <openwrt-devel@...ts.openwrt.org>
Subject: Re: busybox problem on powerpc PPC/32bit (hardware
 TP-Link-WDR-4900-v1)

On Sat, Feb 11, 2023 at 07:27:39PM +0000, Bastian Bittorf wrote:
> On Sat, Feb 11, 2023 at 09:01:03AM -0500, Rich Felker wrote:
> > It looks like the powerpc spe longjmp code is clobbering the value
> > argument. Try the attached patch.
> 
> > diff --git a/src/setjmp/powerpc/longjmp.S b/src/setjmp/powerpc/longjmp.S
> > index 611389fe..465e4cd7 100644
> > --- a/src/setjmp/powerpc/longjmp.S
> > +++ b/src/setjmp/powerpc/longjmp.S
> > @@ -42,10 +42,10 @@ longjmp:
> >  	bl 1f
> >  	.hidden __hwcap
> >  	.long __hwcap-.
> > -1:	mflr 4
> > -	lwz 5, 0(4)
> > -	lwzx 4, 4, 5
> > -	andis. 4, 4, 0x80
> > +1:	mflr 6
> > +	lwz 5, 0(6)
> > +	lwzx 6, 6, 5
> > +	andis. 6, 6, 0x80
> >  	beq 1f
> >  	.long 0x11c35b01 /* evldd 14,88(3) */
> >  	.long 0x11e36301 /* ... */
> 
> Thanks a lot, this looked promising!, but
> sorry, it does NOT solve the issue:
> 
> Using musl-cross-make and this file in
> patches/musl-1.2.0/ppc-spe-longjmp-fix.diff
> i compiled an output/bin/powerpc-linux-muslsf*
> crosscompiler with:
> make TARGET=powerpc-linux-muslsf install
> and used it for further steps...
> 
> maybe the patch did not applied?  
> let me sleep about it...
> 
> Thanks a lot, Bastian

If busybox is static linked, you need to be sure you're linking
against the new libc.a built with the patch applied. If it's dynamic
linked, you need to make sure the shared libc is installed on the
system (but you can use the newly-built patched libc.so *as a command*
to run the dynamic busybox binary and test it).

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.