Skip to contentSkip to conversation

x86: use compat version for preadv2 and pwritev2

PATCH In review Dmitry V. Levin 4 participants 8 messages May 11, 2016 – May 12, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: use compat version for preadv2 and pwritev2

Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries in the 32-bit syscall table.

This bug was found by strace test suite.

Fixes 4babf2c5efb7 ("x86: wire up preadv2 and pwritev2")
---
 arch/x86/entry/syscalls/syscall_32.tbl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/entry/syscalls/syscall_32.tbl +2 -2
index b30dd81..4cddd17 100644
@@ -384,5 +384,5 @@
 375	i386	membarrier		sys_membarrier
 376	i386	mlock2			sys_mlock2
 377	i386	copy_file_range		sys_copy_file_range
-378	i386	preadv2			sys_preadv2
-379	i386	pwritev2		sys_pwritev2
+378	i386	preadv2			sys_preadv2			compat_sys_preadv2
+379	i386	pwritev2		sys_pwritev2			compat_sys_pwritev2
Signature · 1 line
ldv
#1 lore raw
Quoted 2 lines · Dmitry V. Levin

Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries in the 32-bit syscall table.

So this is 2016 and we added a syscalls which require compat support. What's wrong here?

Thanks,

tglx

#2 lore raw
Quoted 6 lines · Thomas Gleixner
Quoted 2 lines · Dmitry V. Levin

Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries in the 32-bit syscall table.

So this is 2016 and we added a syscalls which require compat support. What's wrong here?

I'm not sure I understand your question, it looks to me as "why do we add syscalls that require compat support". If that's what you are asking, I have no idea, I'm a strace man.

Signature · 1 line
ldv
#3 lore raw
Quoted 10 lines · Dmitry V. Levin
Quoted 6 lines · Thomas Gleixner
Quoted 2 lines · Dmitry V. Levin

Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries in the 32-bit syscall table.

So this is 2016 and we added a syscalls which require compat support. What's wrong here?

I'm not sure I understand your question, it looks to me as "why do we add syscalls that require compat support". If that's what you are asking,

Yes, that question was directed at the people who added this in the first place.

Quoted 1 line

I have no idea, I'm a strace man.

I know, you are just the messenger :)

Thanks,

tglx

#4 lore raw
In reply to Thomas Gleixner
Quoted 6 lines · Thomas Gleixner
Quoted 2 lines · Dmitry V. Levin

Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries in the 32-bit syscall table.

So this is 2016 and we added a syscalls which require compat support. What's wrong here?

Nothing. It's and extension of readv/writev and uses struct iovec, which is different for compat vs native. We have efficient infrastructure to deal with that in the kernel, while in userspace people would have to copy around all the iovecs for every I/O, which would be a nightmare.

Reviewed-by on v1 1/1
#5 lore raw
In reply to Dmitry V. Levin
Quoted 4 lines · Dmitry V. Levin

Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries in the 32-bit syscall table.

This bug was found by strace test suite.

Looks fine, thanks.

Btw, can we have a sensible format for the syscalls list that explicitly requires adding _something_ for the compat entry so that errors by ommision like this can't happen?

#6 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Dmitry V. Levin

Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries in the 32-bit syscall table.

This bug was found by strace test suite.

Looks fine, thanks.

BTW, x32 hasn't got entries for preadv2/pwritev2 at all. Not a problem, just a reminder.

Signature · 1 line
ldv
#7 lore raw

[tip:x86/urgent] x86: Use compat version for preadv2 and pwritev2

In reply to Dmitry V. Levin
x86: Use compat version for preadv2 and pwritev2
Commit-ID:  9a7a076e8e4ffcfec05e3cafe4c4e31d41ddbaa0
Gitweb:     http://git.kernel.org/tip/9a7a076e8e4ffcfec05e3cafe4c4e31d41ddbaa0
Author:     Dmitry V. Levin <[email protected]>
AuthorDate: Wed, 11 May 2016 11:48:17 +0300
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Thu, 12 May 2016 14:27:13 +0200

x86: Use compat version for preadv2 and pwritev2

Similar to preadv and pwritev, preadv2 and pwritev2 need compat entries in the 32-bit syscall table.

This bug was found by strace test suite.

---
 arch/x86/entry/syscalls/syscall_32.tbl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/entry/syscalls/syscall_32.tbl +2 -2
index b30dd81..4cddd17 100644
@@ -384,5 +384,5 @@
 375	i386	membarrier		sys_membarrier
 376	i386	mlock2			sys_mlock2
 377	i386	copy_file_range		sys_copy_file_range
-378	i386	preadv2			sys_preadv2
-379	i386	pwritev2		sys_pwritev2
+378	i386	preadv2			sys_preadv2			compat_sys_preadv2
+379	i386	pwritev2		sys_pwritev2			compat_sys_pwritev2