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

On Fri, Feb 16, 2024 at 19:48:27 -0600, Rob Landley wrote:

> https://git.musl-libc.org/cgit/musl/tree/src/signal/sh/sigsetjmp.s

I haven't touched superh asm in a while and the code has zero
comments (*ugh*), but I *think* sigsetjmp clobbers caller's r8.

r8 is callee saved.  sigsetjmp wants to use it to save its env
argument across the call to __setjmp.  So it saves caller's r8 and
uses r8 to save its env b/c __setjmp it's about to call will clobber
it.  Then __setjmp saves this r8 = env in the jump buf, not caller's
r8.  The instruction in the delay slot of the tail call to
__sigsetjmp_tail vaguely looks like it might have been intended to
patch it, but it loads r8, not stores it. I'm not sure why it would
want to load r8 at that point.

Sorry, I only skimmed through the code and as I said, there're no
comments (which for asm code is borderline criminal, IMHO :) so I
might be completely misinterpreting what this code does...

-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.