linux-user/signal.c: Use frame->retcode instead of frame address for alpha target restorer
PATCH 1/1 linux-user/signal.c: Use frame->retcode instead of frame address for alpha target restorer
From: Chen Gang <[email protected]>
The restorer needs the return code address which is frame->retcode, not frame itself.
--- linux-user/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/signal.c +1 -1
@@ -5455,7 +5455,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, &frame->retcode[1]);__put_user (INSN_CALLSYS , &frame->retcode[2 ]);/* imb(); */ - r26 = frame_addr; + r26 = frame_addr + offsetof(struct target_rt_sigframe , retcode); }if (err) {
Signature · 1 line
1.9.3
Quoted 16 lines · Le 29/03/2016 16:01, [email protected] a écrit :
From: Chen Gang <[email protected]>
The restorer needs the return code address which is
frame->retcode, not frame itself.Signed-off-by Chen Gang <[email protected]>--- linux-user/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)linux-user/signal.c +0
-0
linux-user/signal.c static void setup_rt_frame(int sig, struct target_sigaction *ka, · line 5461
Quoted 8 lines
linux-user/signal.c +1
-1@@ -5455,7 +5455,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, &frame->retcode[1]);__put_user (INSN_CALLSYS , &frame->retcode[2 ]);/* imb(); */ - r26 = frame_addr; + r26 = frame_addr + offsetof(struct target_rt_sigframe , retcode); }if (err) {
If you change setup_rt_frame(), you must update setup_frame() too.
It seems correct.
Richard, as you have written the original code, could you check this is correct?
Laurent
Quoted 21 lines · Laurent Vivier
Quoted 20 lines · Le 29/03/2016 16:01, [email protected] a écrit :
The restorer needs the return code address which is
frame->retcode, not frame itself.Signed-off-by Chen Gang <[email protected]>--- linux-user/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)linux-user/signal.c +1
-1@@ -5455,7 +5455,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, &frame->retcode[1]);__put_user (INSN_CALLSYS , &frame->retcode[2 ]);/* imb(); */ - r26 = frame_addr; + r26 = frame_addr + offsetof(struct target_rt_sigframe , retcode); }
Quoted 5 lines
linux-user/signal.c static void setup_rt_frame(int sig, struct target_sigaction *ka, · line 5461
Quoted 2 lines
linux-user/signal.c +0
-0if (err) {If you change
setup_rt_frame(), you must updatesetup_frame()too.
Oh, yes, thanks.
Quoted 5 lines
It seems correct.
Richard, as you have written the original code, could you check this is correct?
Please give a check when you have time.
Thanks.
Signature · 3 lines
Chen Gang (陈刚) Managing Natural Environments is the Duty of Human Beings.
Quoted 30 lines · Laurent Vivier
Quoted 16 lines · Le 29/03/2016 16:01, [email protected] a écrit :
From: Chen Gang <[email protected]>
The restorer needs the return code address which is
frame->retcode, not frame itself.Signed-off-by Chen Gang <[email protected]>--- linux-user/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)linux-user/signal.c +0
-0linux-user/signal.c static void setup_rt_frame(int sig, struct target_sigaction *ka, · line 5461
Quoted 8 lines
linux-user/signal.c +1
-1@@ -5455,7 +5455,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, &frame->retcode[1]);__put_user (INSN_CALLSYS , &frame->retcode[2 ]);/* imb(); */ - r26 = frame_addr; + r26 = frame_addr + offsetof(struct target_rt_sigframe , retcode); }if (err) {If you change
setup_rt_frame(), you must updatesetup_frame()too.
Quoted 4 lines
It seems correct.
Richard, as you have written the original code, could you check this is correct?
Yes, it's correct, and yes both functions need fixing.
In practice, this path is historical and will never be used; it was now a very old glibc that didn't supply a restorer.
r~