All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: fix emulation of splice syscall
@ 2015-03-10 16:11 Andreas Schwab
  2015-03-10 16:13 ` Peter Maydell
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2015-03-10 16:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

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 <schwab@suse.de>
---
 linux-user/syscall.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5720195..4bd9543 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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
-- 
2.3.2

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] linux-user: fix emulation of splice syscall
  2015-03-10 16:11 [Qemu-devel] [PATCH] linux-user: fix emulation of splice syscall Andreas Schwab
@ 2015-03-10 16:13 ` Peter Maydell
  2015-03-10 16:23   ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2015-03-10 16:13 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Riku Voipio, QEMU Developers

On 10 March 2015 at 16:11, Andreas Schwab <schwab@suse.de> wrote:
> 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 <schwab@suse.de>

Is this a v2 of the patch for this you sent a while back?
What's changed?

-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] linux-user: fix emulation of splice syscall
  2015-03-10 16:13 ` Peter Maydell
@ 2015-03-10 16:23   ` Andreas Schwab
  2015-03-10 16:27     ` Peter Maydell
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2015-03-10 16:23 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Riku Voipio, QEMU Developers

Peter Maydell <peter.maydell@linaro.org> writes:

> What's changed?

Only the title.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] linux-user: fix emulation of splice syscall
  2015-03-10 16:23   ` Andreas Schwab
@ 2015-03-10 16:27     ` Peter Maydell
  2015-03-20 18:12       ` [Qemu-devel] [PATCH for-2.3] " Andreas Färber
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2015-03-10 16:27 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Riku Voipio, QEMU Developers

On 10 March 2015 at 16:23, Andreas Schwab <schwab@suse.de> wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
>
>> What's changed?
>
> Only the title.

Please don't drop all the reviewed-by: you got on the first
version, then!

-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.3] linux-user: fix emulation of splice syscall
  2015-03-10 16:27     ` Peter Maydell
@ 2015-03-20 18:12       ` Andreas Färber
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Färber @ 2015-03-20 18:12 UTC (permalink / raw)
  To: Peter Maydell, Riku Voipio; +Cc: Andreas Schwab, QEMU Developers

Am 10.03.2015 um 17:27 schrieb Peter Maydell:
> On 10 March 2015 at 16:23, Andreas Schwab <schwab@suse.de> wrote:
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>
>>> What's changed?
>>
>> Only the title.
> 
> Please don't drop all the reviewed-by: you got on the first
> version, then!

i.e.,

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Ping for -rc1.

Andreas F.

-- 
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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-20 18:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10 16:11 [Qemu-devel] [PATCH] linux-user: fix emulation of splice syscall Andreas Schwab
2015-03-10 16:13 ` Peter Maydell
2015-03-10 16:23   ` Andreas Schwab
2015-03-10 16:27     ` Peter Maydell
2015-03-20 18:12       ` [Qemu-devel] [PATCH for-2.3] " Andreas Färber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.