LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Fix compat_sys_preadv64v2/compat_sys_pwritev64v2
@ 2018-10-31 18:41 H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2018-10-31 18:41 UTC (permalink / raw)
  To: LKML, H. Peter Anvin

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

Update compat_sys_preadv64v2 and compat_sys_pwritev64v2 to handle the
offset argument == -1, which should use and update the the current file
offset.


-- 
H.J.

[-- Attachment #2: 0001-Fix-compat_sys_preadv64v2-compat_sys_pwritev64v2.patch --]
[-- Type: text/x-patch, Size: 1237 bytes --]

From 934a68be8a092dba9558bdf8025239934efb5d7e Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 3 Oct 2018 08:07:18 -0700
Subject: [PATCH] Fix compat_sys_preadv64v2/compat_sys_pwritev64v2

Update compat_sys_preadv64v2 and compat_sys_pwritev64v2 to handle the
offset argument == -1, which should use and update the the current file
offset.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 fs/read_write.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/read_write.c b/fs/read_write.c
index 39b4a21dd933..a61111bdd8c9 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1241,6 +1241,9 @@ COMPAT_SYSCALL_DEFINE5(preadv64v2, unsigned long, fd,
 		const struct compat_iovec __user *,vec,
 		unsigned long, vlen, loff_t, pos, rwf_t, flags)
 {
+	if (pos == -1)
+		return do_compat_readv(fd, vec, vlen, flags);
+
 	return do_compat_preadv64(fd, vec, vlen, pos, flags);
 }
 #endif
@@ -1347,6 +1350,9 @@ COMPAT_SYSCALL_DEFINE5(pwritev64v2, unsigned long, fd,
 		const struct compat_iovec __user *,vec,
 		unsigned long, vlen, loff_t, pos, rwf_t, flags)
 {
+	if (pos == -1)
+		return do_compat_writev(fd, vec, vlen, flags);
+
 	return do_compat_pwritev64(fd, vec, vlen, pos, flags);
 }
 #endif
-- 
2.17.2


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

* [PATCH] Fix compat_sys_preadv64v2/compat_sys_pwritev64v2
@ 2018-10-03 15:10 H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2018-10-03 15:10 UTC (permalink / raw)
  To: linux-kernel

Update compat_sys_preadv64v2 and compat_sys_pwritev64v2 to handle the
offset argument == -1, which should use and update the the current file
offset.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 fs/read_write.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/read_write.c b/fs/read_write.c
index 153f8f690490..c1d183862c13 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1241,6 +1241,9 @@ COMPAT_SYSCALL_DEFINE5(preadv64v2, unsigned long, fd,
 		const struct compat_iovec __user *,vec,
 		unsigned long, vlen, loff_t, pos, rwf_t, flags)
 {
+	if (pos == -1)
+		return do_compat_readv(fd, vec, vlen, flags);
+
 	return do_compat_preadv64(fd, vec, vlen, pos, flags);
 }
 #endif
@@ -1347,6 +1350,9 @@ COMPAT_SYSCALL_DEFINE5(pwritev64v2, unsigned long, fd,
 		const struct compat_iovec __user *,vec,
 		unsigned long, vlen, loff_t, pos, rwf_t, flags)
 {
+	if (pos == -1)
+		return do_compat_writev(fd, vec, vlen, flags);
+
 	return do_compat_pwritev64(fd, vec, vlen, pos, flags);
 }
 #endif
-- 
2.17.1


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

end of thread, other threads:[~2018-10-31 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31 18:41 [PATCH] Fix compat_sys_preadv64v2/compat_sys_pwritev64v2 H.J. Lu
  -- strict thread matches above, loose matches on Subject: below --
2018-10-03 15:10 H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).