diff options
| author | Ingo Molnar <mingo@kernel.org> | 2014-04-02 03:48:56 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2014-04-02 03:48:56 -0400 |
| commit | b8764fe6d0ba654c8705ebbb8c2c8ddd776d8928 (patch) | |
| tree | 3e28a08a044547d5429f011bcce24a3c82c89fec /include/linux/compat.h | |
| parent | b8c89c6a0d56d47ae7f22755a133540b32fa81cf (diff) | |
| parent | 683b6c6f82a60fabf47012581c2cfbf1b037ab95 (diff) | |
Merge branch 'linus' into x86/urgent
Pick up Linus's latest, to fix a bug.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/compat.h')
| -rw-r--r-- | include/linux/compat.h | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index 3f448c65511b..01c0aa57ccec 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/if.h> | 14 | #include <linux/if.h> |
| 15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
| 16 | #include <linux/aio_abi.h> /* for aio_context_t */ | 16 | #include <linux/aio_abi.h> /* for aio_context_t */ |
| 17 | #include <linux/unistd.h> | ||
| 17 | 18 | ||
| 18 | #include <asm/compat.h> | 19 | #include <asm/compat.h> |
| 19 | #include <asm/siginfo.h> | 20 | #include <asm/siginfo.h> |
| @@ -27,6 +28,9 @@ | |||
| 27 | #define __SC_DELOUSE(t,v) ((t)(unsigned long)(v)) | 28 | #define __SC_DELOUSE(t,v) ((t)(unsigned long)(v)) |
| 28 | #endif | 29 | #endif |
| 29 | 30 | ||
| 31 | #define COMPAT_SYSCALL_DEFINE0(name) \ | ||
| 32 | asmlinkage long compat_sys_##name(void) | ||
| 33 | |||
| 30 | #define COMPAT_SYSCALL_DEFINE1(name, ...) \ | 34 | #define COMPAT_SYSCALL_DEFINE1(name, ...) \ |
| 31 | COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) | 35 | COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) |
| 32 | #define COMPAT_SYSCALL_DEFINE2(name, ...) \ | 36 | #define COMPAT_SYSCALL_DEFINE2(name, ...) \ |
| @@ -68,6 +72,8 @@ typedef struct compat_sigaltstack { | |||
| 68 | typedef __compat_uid32_t compat_uid_t; | 72 | typedef __compat_uid32_t compat_uid_t; |
| 69 | typedef __compat_gid32_t compat_gid_t; | 73 | typedef __compat_gid32_t compat_gid_t; |
| 70 | 74 | ||
| 75 | typedef compat_ulong_t compat_aio_context_t; | ||
| 76 | |||
| 71 | struct compat_sel_arg_struct; | 77 | struct compat_sel_arg_struct; |
| 72 | struct rusage; | 78 | struct rusage; |
| 73 | 79 | ||
| @@ -318,7 +324,7 @@ asmlinkage long compat_sys_semctl(int semid, int semnum, int cmd, int arg); | |||
| 318 | asmlinkage long compat_sys_msgsnd(int msqid, compat_uptr_t msgp, | 324 | asmlinkage long compat_sys_msgsnd(int msqid, compat_uptr_t msgp, |
| 319 | compat_ssize_t msgsz, int msgflg); | 325 | compat_ssize_t msgsz, int msgflg); |
| 320 | asmlinkage long compat_sys_msgrcv(int msqid, compat_uptr_t msgp, | 326 | asmlinkage long compat_sys_msgrcv(int msqid, compat_uptr_t msgp, |
| 321 | compat_ssize_t msgsz, long msgtyp, int msgflg); | 327 | compat_ssize_t msgsz, compat_long_t msgtyp, int msgflg); |
| 322 | long compat_sys_msgctl(int first, int second, void __user *uptr); | 328 | long compat_sys_msgctl(int first, int second, void __user *uptr); |
| 323 | long compat_sys_shmctl(int first, int second, void __user *uptr); | 329 | long compat_sys_shmctl(int first, int second, void __user *uptr); |
| 324 | long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, | 330 | long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, |
| @@ -337,6 +343,19 @@ asmlinkage ssize_t compat_sys_preadv(compat_ulong_t fd, | |||
| 337 | asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd, | 343 | asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd, |
| 338 | const struct compat_iovec __user *vec, | 344 | const struct compat_iovec __user *vec, |
| 339 | compat_ulong_t vlen, u32 pos_low, u32 pos_high); | 345 | compat_ulong_t vlen, u32 pos_low, u32 pos_high); |
| 346 | |||
| 347 | #ifdef __ARCH_WANT_COMPAT_SYS_PREADV64 | ||
| 348 | asmlinkage long compat_sys_preadv64(unsigned long fd, | ||
| 349 | const struct compat_iovec __user *vec, | ||
| 350 | unsigned long vlen, loff_t pos); | ||
| 351 | #endif | ||
| 352 | |||
| 353 | #ifdef __ARCH_WANT_COMPAT_SYS_PWRITEV64 | ||
| 354 | asmlinkage long compat_sys_pwritev64(unsigned long fd, | ||
| 355 | const struct compat_iovec __user *vec, | ||
| 356 | unsigned long vlen, loff_t pos); | ||
| 357 | #endif | ||
| 358 | |||
| 340 | asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int); | 359 | asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int); |
| 341 | 360 | ||
| 342 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, | 361 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, |
| @@ -451,7 +470,7 @@ asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, | |||
| 451 | asmlinkage long compat_sys_timerfd_gettime(int ufd, | 470 | asmlinkage long compat_sys_timerfd_gettime(int ufd, |
| 452 | struct compat_itimerspec __user *otmr); | 471 | struct compat_itimerspec __user *otmr); |
| 453 | 472 | ||
| 454 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | 473 | asmlinkage long compat_sys_move_pages(pid_t pid, compat_ulong_t nr_pages, |
| 455 | __u32 __user *pages, | 474 | __u32 __user *pages, |
| 456 | const int __user *nodes, | 475 | const int __user *nodes, |
| 457 | int __user *status, | 476 | int __user *status, |
| @@ -481,20 +500,20 @@ asmlinkage long compat_sys_statfs64(const char __user *pathname, | |||
| 481 | asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, | 500 | asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, |
| 482 | struct compat_statfs64 __user *buf); | 501 | struct compat_statfs64 __user *buf); |
| 483 | asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd, | 502 | asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd, |
| 484 | unsigned long arg); | 503 | compat_ulong_t arg); |
| 485 | asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd, | 504 | asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd, |
| 486 | unsigned long arg); | 505 | compat_ulong_t arg); |
| 487 | asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p); | 506 | asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p); |
| 488 | asmlinkage long compat_sys_io_getevents(aio_context_t ctx_id, | 507 | asmlinkage long compat_sys_io_getevents(compat_aio_context_t ctx_id, |
| 489 | unsigned long min_nr, | 508 | compat_long_t min_nr, |
| 490 | unsigned long nr, | 509 | compat_long_t nr, |
| 491 | struct io_event __user *events, | 510 | struct io_event __user *events, |
| 492 | struct compat_timespec __user *timeout); | 511 | struct compat_timespec __user *timeout); |
| 493 | asmlinkage long compat_sys_io_submit(aio_context_t ctx_id, int nr, | 512 | asmlinkage long compat_sys_io_submit(compat_aio_context_t ctx_id, int nr, |
| 494 | u32 __user *iocb); | 513 | u32 __user *iocb); |
| 495 | asmlinkage long compat_sys_mount(const char __user *dev_name, | 514 | asmlinkage long compat_sys_mount(const char __user *dev_name, |
| 496 | const char __user *dir_name, | 515 | const char __user *dir_name, |
| 497 | const char __user *type, unsigned long flags, | 516 | const char __user *type, compat_ulong_t flags, |
| 498 | const void __user *data); | 517 | const void __user *data); |
| 499 | asmlinkage long compat_sys_old_readdir(unsigned int fd, | 518 | asmlinkage long compat_sys_old_readdir(unsigned int fd, |
| 500 | struct compat_old_linux_dirent __user *, | 519 | struct compat_old_linux_dirent __user *, |
| @@ -502,9 +521,11 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd, | |||
| 502 | asmlinkage long compat_sys_getdents(unsigned int fd, | 521 | asmlinkage long compat_sys_getdents(unsigned int fd, |
| 503 | struct compat_linux_dirent __user *dirent, | 522 | struct compat_linux_dirent __user *dirent, |
| 504 | unsigned int count); | 523 | unsigned int count); |
| 524 | #ifdef __ARCH_WANT_COMPAT_SYS_GETDENTS64 | ||
| 505 | asmlinkage long compat_sys_getdents64(unsigned int fd, | 525 | asmlinkage long compat_sys_getdents64(unsigned int fd, |
| 506 | struct linux_dirent64 __user *dirent, | 526 | struct linux_dirent64 __user *dirent, |
| 507 | unsigned int count); | 527 | unsigned int count); |
| 528 | #endif | ||
| 508 | asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, | 529 | asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, |
| 509 | unsigned int nr_segs, unsigned int flags); | 530 | unsigned int nr_segs, unsigned int flags); |
| 510 | asmlinkage long compat_sys_open(const char __user *filename, int flags, | 531 | asmlinkage long compat_sys_open(const char __user *filename, int flags, |
| @@ -549,9 +570,9 @@ asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg, | |||
| 549 | unsigned vlen, unsigned int flags); | 570 | unsigned vlen, unsigned int flags); |
| 550 | asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, | 571 | asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, |
| 551 | unsigned int flags); | 572 | unsigned int flags); |
| 552 | asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, | 573 | asmlinkage long compat_sys_recv(int fd, void __user *buf, compat_size_t len, |
| 553 | unsigned flags); | 574 | unsigned flags); |
| 554 | asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len, | 575 | asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, compat_size_t len, |
| 555 | unsigned flags, struct sockaddr __user *addr, | 576 | unsigned flags, struct sockaddr __user *addr, |
| 556 | int __user *addrlen); | 577 | int __user *addrlen); |
| 557 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, | 578 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, |
| @@ -615,16 +636,16 @@ asmlinkage long compat_sys_rt_sigqueueinfo(compat_pid_t pid, int sig, | |||
| 615 | struct compat_siginfo __user *uinfo); | 636 | struct compat_siginfo __user *uinfo); |
| 616 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); | 637 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); |
| 617 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | 638 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, |
| 618 | unsigned long arg); | 639 | compat_ulong_t arg); |
| 619 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, | 640 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, |
| 620 | struct compat_timespec __user *utime, u32 __user *uaddr2, | 641 | struct compat_timespec __user *utime, u32 __user *uaddr2, |
| 621 | u32 val3); | 642 | u32 val3); |
| 622 | asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, | 643 | asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, |
| 623 | char __user *optval, int __user *optlen); | 644 | char __user *optval, int __user *optlen); |
| 624 | asmlinkage long compat_sys_kexec_load(unsigned long entry, | 645 | asmlinkage long compat_sys_kexec_load(compat_ulong_t entry, |
| 625 | unsigned long nr_segments, | 646 | compat_ulong_t nr_segments, |
| 626 | struct compat_kexec_segment __user *, | 647 | struct compat_kexec_segment __user *, |
| 627 | unsigned long flags); | 648 | compat_ulong_t flags); |
| 628 | asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, | 649 | asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, |
| 629 | const struct compat_mq_attr __user *u_mqstat, | 650 | const struct compat_mq_attr __user *u_mqstat, |
| 630 | struct compat_mq_attr __user *u_omqstat); | 651 | struct compat_mq_attr __user *u_omqstat); |
| @@ -635,11 +656,11 @@ asmlinkage long compat_sys_mq_open(const char __user *u_name, | |||
| 635 | struct compat_mq_attr __user *u_attr); | 656 | struct compat_mq_attr __user *u_attr); |
| 636 | asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes, | 657 | asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes, |
| 637 | const char __user *u_msg_ptr, | 658 | const char __user *u_msg_ptr, |
| 638 | size_t msg_len, unsigned int msg_prio, | 659 | compat_size_t msg_len, unsigned int msg_prio, |
| 639 | const struct compat_timespec __user *u_abs_timeout); | 660 | const struct compat_timespec __user *u_abs_timeout); |
| 640 | asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes, | 661 | asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes, |
| 641 | char __user *u_msg_ptr, | 662 | char __user *u_msg_ptr, |
| 642 | size_t msg_len, unsigned int __user *u_msg_prio, | 663 | compat_size_t msg_len, unsigned int __user *u_msg_prio, |
| 643 | const struct compat_timespec __user *u_abs_timeout); | 664 | const struct compat_timespec __user *u_abs_timeout); |
| 644 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args); | 665 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args); |
| 645 | asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args); | 666 | asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args); |
| @@ -654,12 +675,12 @@ extern void __user *compat_alloc_user_space(unsigned long len); | |||
| 654 | 675 | ||
| 655 | asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid, | 676 | asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid, |
| 656 | const struct compat_iovec __user *lvec, | 677 | const struct compat_iovec __user *lvec, |
| 657 | unsigned long liovcnt, const struct compat_iovec __user *rvec, | 678 | compat_ulong_t liovcnt, const struct compat_iovec __user *rvec, |
| 658 | unsigned long riovcnt, unsigned long flags); | 679 | compat_ulong_t riovcnt, compat_ulong_t flags); |
| 659 | asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, | 680 | asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, |
| 660 | const struct compat_iovec __user *lvec, | 681 | const struct compat_iovec __user *lvec, |
| 661 | unsigned long liovcnt, const struct compat_iovec __user *rvec, | 682 | compat_ulong_t liovcnt, const struct compat_iovec __user *rvec, |
| 662 | unsigned long riovcnt, unsigned long flags); | 683 | compat_ulong_t riovcnt, compat_ulong_t flags); |
| 663 | 684 | ||
| 664 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, | 685 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, |
| 665 | compat_off_t __user *offset, compat_size_t count); | 686 | compat_off_t __user *offset, compat_size_t count); |
