Message ID | 20210428193408.233706-6-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | linux-user/s390x: some signal fixes | expand |
On 28.04.21 21:33, Richard Henderson wrote: > Directly reading sc->regs.psw.addr misses the bswap > that may be performed by __get_user. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > linux-user/s390x/signal.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c > index e455a9818d..dcc6f7bc02 100644 > --- a/linux-user/s390x/signal.c > +++ b/linux-user/s390x/signal.c > @@ -232,16 +232,17 @@ give_sigsegv: > > static void restore_sigregs(CPUS390XState *env, target_sigregs *sc) > { > + target_ulong prev_addr; > int i; > > for (i = 0; i < 16; i++) { > __get_user(env->regs[i], &sc->regs.gprs[i]); > } > > + prev_addr = env->psw.addr; > __get_user(env->psw.mask, &sc->regs.psw.mask); > - trace_user_s390x_restore_sigregs(env, (unsigned long long)sc->regs.psw.addr, > - (unsigned long long)env->psw.addr); > __get_user(env->psw.addr, &sc->regs.psw.addr); > + trace_user_s390x_restore_sigregs(env, env->psw.addr, prev_addr); > > for (i = 0; i < 16; i++) { > __get_user(env->aregs[i], &sc->regs.acrs[i]); > Reviewed-by: David Hildenbrand <david@redhat.com> -- Thanks, David / dhildenb
diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index e455a9818d..dcc6f7bc02 100644 --- a/linux-user/s390x/signal.c +++ b/linux-user/s390x/signal.c @@ -232,16 +232,17 @@ give_sigsegv: static void restore_sigregs(CPUS390XState *env, target_sigregs *sc) { + target_ulong prev_addr; int i; for (i = 0; i < 16; i++) { __get_user(env->regs[i], &sc->regs.gprs[i]); } + prev_addr = env->psw.addr; __get_user(env->psw.mask, &sc->regs.psw.mask); - trace_user_s390x_restore_sigregs(env, (unsigned long long)sc->regs.psw.addr, - (unsigned long long)env->psw.addr); __get_user(env->psw.addr, &sc->regs.psw.addr); + trace_user_s390x_restore_sigregs(env, env->psw.addr, prev_addr); for (i = 0; i < 16; i++) { __get_user(env->aregs[i], &sc->regs.acrs[i]);
Directly reading sc->regs.psw.addr misses the bswap that may be performed by __get_user. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/s390x/signal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1