linux-user: fix emulation of splice syscall
PATCH 1/1 linux-user: fix emulation of splice syscall
The second and fourth argument are in/out parameters, store them back after the syscall. Also, the fourth argument was mishandled, and EFAULT handling was missing.
--- linux-user/syscall.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
linux-user/syscall.c +18 -4
@@ -9351,15 +9351,29 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, {loff_t loff_in, loff_out;loff_t *ploff_in =NULL , *ploff_out =NULL ; -if (arg2) { -get_user_u64 (loff_in, arg2); +if (arg2) { +if (get_user_u64 (loff_in, arg2)) { + goto efault; + } ploff_in = &loff_in; } -if (arg4) { -get_user_u64 (loff_out, arg2); +if (arg4) { +if (get_user_u64 (loff_out, arg4)) { + goto efault; + } ploff_out = &loff_out; } ret =get_errno (splice (arg1, ploff_in, arg3, ploff_out, arg5, arg6)); +if (arg2) { +if (put_user_u64 (loff_in, arg2)) { + goto efault; + } + } +if (arg4) { +if (put_user_u64 (loff_out, arg4)) { + goto efault; + } + } }break ;#endif
Signature · 6 lines
2.3.2 -- Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Quoted 5 lines · Andreas Schwab
The second and fourth argument are in/out parameters, store them back after the syscall. Also, the fourth argument was mishandled, and EFAULT handling was missing.
Signed-off-by Andreas Schwab <[email protected]>
Is this a v2 of the patch for this you sent a while back? What's changed?
-- PMM
Quoted 1 line · Peter Maydell
What's changed?
Only the title.
Andreas.
Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Quoted 5 lines · Andreas Schwab
Quoted 1 line · Peter Maydell
What's changed?
Only the title.
Please don't drop all the reviewed-by: you got on the first version, then!
-- PMM
Andreas Färber
Reviewed-by Peter MaydellAm 10.03.2015 um 17:27 schrieb Peter Maydell:
Quoted 9 lines · Andreas Schwab
Quoted 5 lines
Quoted 1 line · Peter Maydell
What's changed?
Only the title.
Please don't drop all the reviewed-by: you got on the first version, then!
i.e.,
Ping for -rc1.
Andreas F.
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton; HRB 21284 (AG Nürnberg)