linux-user: Fix sched_getaffinity mask size
PATCH v2 1/1 linux-user: Fix sched_getaffinity mask size
We properly computed the capped mask size to be put to the application buffer, but didn't actually used it. Also, we need to return the capped mask size instead of 0 on success.
---
Difference from v1:
- simplify fix
--- linux-user/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
linux-user/syscall.c +3 -1
@@ -10493,7 +10493,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret = arg2; } - ret =host_to_target_cpu_mask (mask, mask_size, arg3, arg2); +if (host_to_target_cpu_mask (mask, mask_size, arg3, ret)) { + goto efault; + } } }break ;
Signature · 1 line
2.15.1
Le 11/02/2018 à 18:47, Samuel Thibault a écrit :
Quoted 19 lines
We properly computed the capped mask size to be put to the application buffer, but didn't actually used it. Also, we need to return the capped mask size instead of 0 on success.
Signed-off-by Samuel Thibault <[email protected]>---
Difference from v1:
- simplify fix--- linux-user/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)linux-user/syscall.c +0
-0
linux-user/syscall.c abi_long do_syscall(void *cpu_env, int num, abi_long arg1, · line 10501
Quoted 10 lines
linux-user/syscall.c +3
-1@@ -10493,7 +10493,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret = arg2; } - ret =host_to_target_cpu_mask (mask, mask_size, arg3, arg2); +if (host_to_target_cpu_mask (mask, mask_size, arg3, ret)) { + goto efault; + } } }break ;
Laurent Vivier
AppliedLe 11/02/2018 à 18:47, Samuel Thibault a écrit :
Quoted 19 lines
We properly computed the capped mask size to be put to the application buffer, but didn't actually used it. Also, we need to return the capped mask size instead of 0 on success.
Signed-off-by Samuel Thibault <[email protected]>---
Difference from v1:
- simplify fix--- linux-user/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)linux-user/syscall.c +0
-0
linux-user/syscall.c abi_long do_syscall(void *cpu_env, int num, abi_long arg1, · line 10501
Quoted 10 lines
linux-user/syscall.c +3
-1@@ -10493,7 +10493,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret = arg2; } - ret =host_to_target_cpu_mask (mask, mask_size, arg3, arg2); +if (host_to_target_cpu_mask (mask, mask_size, arg3, ret)) { + goto efault; + } } }break ;
Applied to my 'linux-user-for-2.12' branch.
Thanks,
Laurent