Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZdH-SF2_dzVR4hJe@snips.stderr.spb.ru>
Date: Sun, 18 Feb 2024 15:55:36 +0300
From: Valery Ushakov <uwe@...err.spb.ru>
To: musl@...ts.openwall.com, toybox <toybox@...ts.landley.net>
Subject: Re: Re: Not sure how to debug this one.

On Sat, Feb 17, 2024 at 20:40:50 -0500, Rich Felker wrote:

> due to incorrect base address register when attempting to reload the
> saved value of r8, the caller's value of r8 was not preserved.
> ---
>  src/signal/sh/sigsetjmp.s | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/signal/sh/sigsetjmp.s b/src/signal/sh/sigsetjmp.s
> index 1e2270be..f0f604e2 100644
> --- a/src/signal/sh/sigsetjmp.s
> +++ b/src/signal/sh/sigsetjmp.s
> @@ -27,7 +27,7 @@ __sigsetjmp:
>  
>  	mov.l 3f, r0
>  4:	braf r0
> -	 mov.l @(4+8,r4), r8
> +	 mov.l @(4+8,r6), r8
>  
>  9:	mov.l 5f, r0
>  6:	braf r0

That takes care of restoring caller's r8 for the first return from
sigsetjmp, but isn't there still the problem that the jump buffer
contains the wrong one, so on the second return from sigsetjmp the
caller will have clobbered r8?

Sorry for a drive-by reply.  I'll try to take a closer look in the
evening.


-uwe

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.