Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200812214405.GE879655@port70.net>
Date: Wed, 12 Aug 2020 23:44:05 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: Alexander Monakov <amonakov@...ras.ru>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH 1/3] setjmp: fix x86-64 longjmp argument adjustment

* Alexander Monakov <amonakov@...ras.ru> [2020-08-12 16:29:59 +0300]:
> By the way, you should check if other 64-bit ports in musl exhibit
> the same issue. The AArch64 port definitely does, for example.
> 
> Here's a standalone testcase, needs -O2 so test_lj passes its second
> argument unchanged:

yes it seems wrong, see attached patch (with that the test passes).
thanks.

> 
> #include <setjmp.h>
> 
> static void test_lj(jmp_buf jb, long lv)
> {
>         longjmp(jb, lv);
> }
> 
> int main()
> {
>         void (*volatile ptest)(jmp_buf, long) = 0;
>         jmp_buf jb;
> 
>         int v = setjmp(jb);
>         ptest = ptest ? 0 : test_lj;
>         if (ptest) ptest(jb, 1l<<32);
>         return !v;
> }
> 
> 
> Alexander

View attachment "0001-aarch64-fix-setjmp-return-value.patch" of type "text/x-diff" (823 bytes)

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.