[PATCH] compat: move compat*at syscall prototypes into compat.h

[PATCH] compat: move compat*at syscall prototypes into compat.h

Post by Stephen Ro » Wed, 08 Feb 2006 09:00:10


For consistency with all the other compat syscalls.

Signed-off-by: Stephen Rothwell < XXXX@XXXXX.COM >
---

include/linux/compat.h | 8 ++++++++
include/linux/syscalls.h | 9 ---------
2 files changed, 8 insertions(+), 9 deletions(-)
--
Cheers,
Stephen Rothwell XXXX@XXXXX.COM
http://www.yqcomputer.com/ ~sfr/

f3e3d29e9c87c8e15e5678925f21a708b4a7c961
diff --git a/include/linux/compat.h b/include/linux/compat.h
index f9ca534..2d7e7f1 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -161,5 +161,13 @@ int copy_siginfo_to_user32(struct compat
int get_compat_sigevent(struct sigevent *event,
const struct compat_sigevent __user *u_event);

+asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename,
+ struct compat_timeval __user *t);
+asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename,
+ struct compat_stat __user *statbuf,
+ int flag);
+asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
+ int flags, int mode);
+
#endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 3877209..24240b6 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -50,8 +50,6 @@ struct timezone;
struct tms;
struct utimbuf;
struct mq_attr;
-struct compat_stat;
-struct compat_timeval;

#include <linux/config.h>
#include <linux/types.h>
@@ -559,12 +557,5 @@ asmlinkage long sys_newfstatat(int dfd,
struct stat __user *statbuf, int flag);
asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf,
int bufsiz);
-asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename,
- struct compat_timeval __user *t);
-asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename,
- struct compat_stat __user *statbuf,
- int flag);
-asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
- int flags, int mode);

#endif
--
1.1.5
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

1. [patch] (2nd try) add epoll compat code to kernel/compat.c ...

2. [PATCH 0/4 RESEND] exec: unify compat/non-compat code


>> >
>> > Shouldn't these be compat_ptr(argv)? makes a difference on s390)

Indeed. The "compat_uptr_t __user *argv" is wrong, and it should be just

compat_uptr_t argv;

and then every time you turn it into a pointer, it should use
"compat_ptr(argv)".

Then, since it's a pointer to an array of pointers, when you do that,
you should turn it into a pointer to "compat_uptr_t", so you actually
have this:

- user passes "compat_uptr_t"

- the kernel can turn that into "compat_uptr_t __user *" by doing

compat_uptr_t __user *pptr;
pptr = compat_ptr(argv);

- the kernel needs to fetch the individual entries with

compat_uptr_t cuptr = get_user(pptr);

- the kernel can then turn _those_ into the actual pointers to the string with

const char __user *str = compat_ptr(cuptr);

so you need two levels of compat_ptr() co>version.

> So, once again, this should not (and can not) be compat_ptr(argv) afaics.

It can be, and probably should. But the low-level s390 wrapper
function may have done one of the levels already. It probably
shouldn't, and we _should_ do the "compat_ptr()" thing a the generic C
level. That's what we do with all the other pointers, after all.

Linus
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

3. [patch] add epoll compat code to kernel/compat.c ...

4. [PATCH 2/2] BLOCK: Fix linux/compat.h's use sigset_t

5. [PATCH 23/25] cdrom: move ioctl32 code to drivers/cdrom/compat.c

6. [PATCH 1/3] move rtc compat ioctl handling to fs/compat_ioctl.c

7. [PATCH 02/25] net: move socket ioctl32 to net/compat.c

8. [09/07] sparc64: use message queue compat syscalls

9. [PATCH] move common compat ioctls to hash

10. compat syscall args

11. [PATCH 6/10] Vmi supports compat vdso.patch

12. [PATCH] ov511-2.28 patch for 2.6.11 kernel compat.

13. [PATCH] ov511-2.28 patch for 2.6.12 kernel compat.

14. [PATCH 1/2] BLOCK: Revert patch to hack around undeclared sigset_t in linux/compat.h

15. [PATCH 2.6.17-rc5-mm2 05/18] raw1394: fix whitespace after x86_64 compat patch