linux-user: Fix unlock_user() call in return from poll()
PATCH 1/1 linux-user: Fix unlock_user() call in return from poll()
Correct the broken attempt to calculate the third argument to unlock_user() in the code path which unlocked the pollfd array on return from poll() and ppoll() emulation. (This only caused a problem if unlock_user() wasn't a no-op, eg if DEBUG_REMAP is defined.)
Signed-off-by Peter Maydell <[email protected]>
--- linux-user/syscall.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
linux-user/syscall.c +1 -3
@@ -6314,10 +6314,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,for (i =0 ; i < nfds; i++) { target_pfd[i].revents =tswap16 (pfd[i].revents); } - ret += nfds * (sizeof (struct target_pollfd ) - - sizeof(struct pollfd)); } -unlock_user (target_pfd, arg1, ret); +unlock_user (target_pfd, arg1,sizeof (struct target_pollfd ) * nfds); }break ;#endif
Signature · 1 line
1.7.1
Aurelien Jarno
AppliedQuoted 10 lines · Peter Maydell
Correct the broken attempt to calculate the third argument to
unlock_user()in the code path which unlocked the pollfd array on return frompoll()andppoll()emulation. (This only caused a problem ifunlock_user()wasn't a no-op, eg ifDEBUG_REMAPis defined.)Signed-off-by Peter Maydell <[email protected]>--- linux-user/syscall.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
Thanks, applied.
Quoted 21 lines
linux-user/syscall.c +1
-3@@ -6314,10 +6314,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,for (i =0 ; i < nfds; i++) { target_pfd[i].revents =tswap16 (pfd[i].revents); } - ret += nfds * (sizeof (struct target_pollfd ) - - sizeof(struct pollfd)); } -unlock_user (target_pfd, arg1, ret); +unlock_user (target_pfd, arg1,sizeof (struct target_pollfd ) * nfds); }break ;#endif Signature · 1 line
1.7.1
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net