| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * syscalls.h - Linux syscall interfaces (non-arch-specific) |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2004 Randy Dunlap |
|---|
| 5 | 6 | * Copyright (c) 2004 Open Source Development Labs |
|---|
| 6 | | - * |
|---|
| 7 | | - * This file is released under the GPLv2. |
|---|
| 8 | | - * See the file COPYING for more details. |
|---|
| 9 | 7 | */ |
|---|
| 10 | 8 | |
|---|
| 11 | 9 | #ifndef _LINUX_SYSCALLS_H |
|---|
| .. | .. |
|---|
| 18 | 16 | struct iocb; |
|---|
| 19 | 17 | struct io_event; |
|---|
| 20 | 18 | struct iovec; |
|---|
| 21 | | -struct itimerspec; |
|---|
| 22 | | -struct itimerval; |
|---|
| 19 | +struct __kernel_old_itimerval; |
|---|
| 23 | 20 | struct kexec_segment; |
|---|
| 24 | 21 | struct linux_dirent; |
|---|
| 25 | 22 | struct linux_dirent64; |
|---|
| .. | .. |
|---|
| 50 | 47 | struct statfs; |
|---|
| 51 | 48 | struct statfs64; |
|---|
| 52 | 49 | struct statx; |
|---|
| 53 | | -struct __sysctl_args; |
|---|
| 54 | 50 | struct sysinfo; |
|---|
| 55 | 51 | struct timespec; |
|---|
| 56 | | -struct timeval; |
|---|
| 57 | | -struct timex; |
|---|
| 52 | +struct __kernel_old_timeval; |
|---|
| 53 | +struct __kernel_timex; |
|---|
| 58 | 54 | struct timezone; |
|---|
| 59 | 55 | struct tms; |
|---|
| 60 | 56 | struct utimbuf; |
|---|
| 61 | 57 | struct mq_attr; |
|---|
| 62 | 58 | struct compat_stat; |
|---|
| 63 | | -struct compat_timeval; |
|---|
| 59 | +struct old_timeval32; |
|---|
| 64 | 60 | struct robust_list_head; |
|---|
| 65 | 61 | struct getcpu_cache; |
|---|
| 66 | 62 | struct old_linux_dirent; |
|---|
| .. | .. |
|---|
| 69 | 65 | struct sigaltstack; |
|---|
| 70 | 66 | struct rseq; |
|---|
| 71 | 67 | union bpf_attr; |
|---|
| 68 | +struct io_uring_params; |
|---|
| 69 | +struct clone_args; |
|---|
| 70 | +struct open_how; |
|---|
| 72 | 71 | |
|---|
| 73 | 72 | #include <linux/types.h> |
|---|
| 74 | 73 | #include <linux/aio_abi.h> |
|---|
| .. | .. |
|---|
| 145 | 144 | .flags = TRACE_EVENT_FL_CAP_ANY, \ |
|---|
| 146 | 145 | }; \ |
|---|
| 147 | 146 | static struct trace_event_call __used \ |
|---|
| 148 | | - __attribute__((section("_ftrace_events"))) \ |
|---|
| 147 | + __section("_ftrace_events") \ |
|---|
| 149 | 148 | *__event_enter_##sname = &event_enter_##sname; |
|---|
| 150 | 149 | |
|---|
| 151 | 150 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
|---|
| .. | .. |
|---|
| 161 | 160 | .flags = TRACE_EVENT_FL_CAP_ANY, \ |
|---|
| 162 | 161 | }; \ |
|---|
| 163 | 162 | static struct trace_event_call __used \ |
|---|
| 164 | | - __attribute__((section("_ftrace_events"))) \ |
|---|
| 163 | + __section("_ftrace_events") \ |
|---|
| 165 | 164 | *__event_exit_##sname = &event_exit_##sname; |
|---|
| 166 | 165 | |
|---|
| 167 | 166 | #define SYSCALL_METADATA(sname, nb, ...) \ |
|---|
| .. | .. |
|---|
| 185 | 184 | .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ |
|---|
| 186 | 185 | }; \ |
|---|
| 187 | 186 | static struct syscall_metadata __used \ |
|---|
| 188 | | - __attribute__((section("__syscalls_metadata"))) \ |
|---|
| 187 | + __section("__syscalls_metadata") \ |
|---|
| 189 | 188 | *__p_syscall_meta_##sname = &__syscall_meta_##sname; |
|---|
| 190 | 189 | |
|---|
| 191 | 190 | static inline int is_syscall_trace_event(struct trace_event_call *tp_event) |
|---|
| .. | .. |
|---|
| 252 | 251 | static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) |
|---|
| 253 | 252 | #endif /* __SYSCALL_DEFINEx */ |
|---|
| 254 | 253 | |
|---|
| 254 | +/* For split 64-bit arguments on 32-bit architectures */ |
|---|
| 255 | +#ifdef __LITTLE_ENDIAN |
|---|
| 256 | +#define SC_ARG64(name) u32, name##_lo, u32, name##_hi |
|---|
| 257 | +#else |
|---|
| 258 | +#define SC_ARG64(name) u32, name##_hi, u32, name##_lo |
|---|
| 259 | +#endif |
|---|
| 260 | +#define SC_VAL64(type, name) ((type) name##_hi << 32 | name##_lo) |
|---|
| 261 | + |
|---|
| 262 | +#ifdef CONFIG_COMPAT |
|---|
| 263 | +#define SYSCALL32_DEFINE1 COMPAT_SYSCALL_DEFINE1 |
|---|
| 264 | +#define SYSCALL32_DEFINE2 COMPAT_SYSCALL_DEFINE2 |
|---|
| 265 | +#define SYSCALL32_DEFINE3 COMPAT_SYSCALL_DEFINE3 |
|---|
| 266 | +#define SYSCALL32_DEFINE4 COMPAT_SYSCALL_DEFINE4 |
|---|
| 267 | +#define SYSCALL32_DEFINE5 COMPAT_SYSCALL_DEFINE5 |
|---|
| 268 | +#define SYSCALL32_DEFINE6 COMPAT_SYSCALL_DEFINE6 |
|---|
| 269 | +#else |
|---|
| 270 | +#define SYSCALL32_DEFINE1 SYSCALL_DEFINE1 |
|---|
| 271 | +#define SYSCALL32_DEFINE2 SYSCALL_DEFINE2 |
|---|
| 272 | +#define SYSCALL32_DEFINE3 SYSCALL_DEFINE3 |
|---|
| 273 | +#define SYSCALL32_DEFINE4 SYSCALL_DEFINE4 |
|---|
| 274 | +#define SYSCALL32_DEFINE5 SYSCALL_DEFINE5 |
|---|
| 275 | +#define SYSCALL32_DEFINE6 SYSCALL_DEFINE6 |
|---|
| 276 | +#endif |
|---|
| 277 | + |
|---|
| 255 | 278 | /* |
|---|
| 256 | 279 | * Called before coming back to user-mode. Returning to user-mode with an |
|---|
| 257 | 280 | * address limit different than USER_DS can allow to overwrite kernel memory. |
|---|
| .. | .. |
|---|
| 263 | 286 | return; |
|---|
| 264 | 287 | #endif |
|---|
| 265 | 288 | |
|---|
| 266 | | - if (CHECK_DATA_CORRUPTION(!segment_eq(get_fs(), USER_DS), |
|---|
| 289 | + if (CHECK_DATA_CORRUPTION(uaccess_kernel(), |
|---|
| 267 | 290 | "Invalid address limit on user-mode return")) |
|---|
| 268 | | - force_sig(SIGKILL, current); |
|---|
| 291 | + force_sig(SIGKILL); |
|---|
| 269 | 292 | |
|---|
| 270 | 293 | #ifdef TIF_FSCHECK |
|---|
| 271 | 294 | clear_thread_flag(TIF_FSCHECK); |
|---|
| .. | .. |
|---|
| 296 | 319 | long min_nr, |
|---|
| 297 | 320 | long nr, |
|---|
| 298 | 321 | struct io_event __user *events, |
|---|
| 299 | | - struct timespec __user *timeout); |
|---|
| 322 | + struct __kernel_timespec __user *timeout); |
|---|
| 323 | +asmlinkage long sys_io_getevents_time32(__u32 ctx_id, |
|---|
| 324 | + __s32 min_nr, |
|---|
| 325 | + __s32 nr, |
|---|
| 326 | + struct io_event __user *events, |
|---|
| 327 | + struct old_timespec32 __user *timeout); |
|---|
| 300 | 328 | asmlinkage long sys_io_pgetevents(aio_context_t ctx_id, |
|---|
| 301 | 329 | long min_nr, |
|---|
| 302 | 330 | long nr, |
|---|
| 303 | 331 | struct io_event __user *events, |
|---|
| 304 | | - struct timespec __user *timeout, |
|---|
| 332 | + struct __kernel_timespec __user *timeout, |
|---|
| 305 | 333 | const struct __aio_sigset *sig); |
|---|
| 334 | +asmlinkage long sys_io_pgetevents_time32(aio_context_t ctx_id, |
|---|
| 335 | + long min_nr, |
|---|
| 336 | + long nr, |
|---|
| 337 | + struct io_event __user *events, |
|---|
| 338 | + struct old_timespec32 __user *timeout, |
|---|
| 339 | + const struct __aio_sigset *sig); |
|---|
| 340 | +asmlinkage long sys_io_uring_setup(u32 entries, |
|---|
| 341 | + struct io_uring_params __user *p); |
|---|
| 342 | +asmlinkage long sys_io_uring_enter(unsigned int fd, u32 to_submit, |
|---|
| 343 | + u32 min_complete, u32 flags, |
|---|
| 344 | + const void __user *argp, size_t argsz); |
|---|
| 345 | +asmlinkage long sys_io_uring_register(unsigned int fd, unsigned int op, |
|---|
| 346 | + void __user *arg, unsigned int nr_args); |
|---|
| 306 | 347 | |
|---|
| 307 | 348 | /* fs/xattr.c */ |
|---|
| 308 | 349 | asmlinkage long sys_setxattr(const char __user *path, const char __user *name, |
|---|
| .. | .. |
|---|
| 410 | 451 | #endif |
|---|
| 411 | 452 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); |
|---|
| 412 | 453 | asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode); |
|---|
| 454 | +asmlinkage long sys_faccessat2(int dfd, const char __user *filename, int mode, |
|---|
| 455 | + int flags); |
|---|
| 413 | 456 | asmlinkage long sys_chdir(const char __user *filename); |
|---|
| 414 | 457 | asmlinkage long sys_fchdir(unsigned int fd); |
|---|
| 415 | 458 | asmlinkage long sys_chroot(const char __user *filename); |
|---|
| .. | .. |
|---|
| 421 | 464 | asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group); |
|---|
| 422 | 465 | asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, |
|---|
| 423 | 466 | umode_t mode); |
|---|
| 467 | +asmlinkage long sys_openat2(int dfd, const char __user *filename, |
|---|
| 468 | + struct open_how *how, size_t size); |
|---|
| 424 | 469 | asmlinkage long sys_close(unsigned int fd); |
|---|
| 470 | +asmlinkage long sys_close_range(unsigned int fd, unsigned int max_fd, |
|---|
| 471 | + unsigned int flags); |
|---|
| 425 | 472 | asmlinkage long sys_vhangup(void); |
|---|
| 426 | 473 | |
|---|
| 427 | 474 | /* fs/pipe.c */ |
|---|
| .. | .. |
|---|
| 466 | 513 | |
|---|
| 467 | 514 | /* fs/select.c */ |
|---|
| 468 | 515 | asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *, |
|---|
| 469 | | - fd_set __user *, struct timespec __user *, |
|---|
| 516 | + fd_set __user *, struct __kernel_timespec __user *, |
|---|
| 517 | + void __user *); |
|---|
| 518 | +asmlinkage long sys_pselect6_time32(int, fd_set __user *, fd_set __user *, |
|---|
| 519 | + fd_set __user *, struct old_timespec32 __user *, |
|---|
| 470 | 520 | void __user *); |
|---|
| 471 | 521 | asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, |
|---|
| 472 | | - struct timespec __user *, const sigset_t __user *, |
|---|
| 522 | + struct __kernel_timespec __user *, const sigset_t __user *, |
|---|
| 523 | + size_t); |
|---|
| 524 | +asmlinkage long sys_ppoll_time32(struct pollfd __user *, unsigned int, |
|---|
| 525 | + struct old_timespec32 __user *, const sigset_t __user *, |
|---|
| 473 | 526 | size_t); |
|---|
| 474 | 527 | |
|---|
| 475 | 528 | /* fs/signalfd.c */ |
|---|
| .. | .. |
|---|
| 510 | 563 | const struct __kernel_itimerspec __user *utmr, |
|---|
| 511 | 564 | struct __kernel_itimerspec __user *otmr); |
|---|
| 512 | 565 | asmlinkage long sys_timerfd_gettime(int ufd, struct __kernel_itimerspec __user *otmr); |
|---|
| 566 | +asmlinkage long sys_timerfd_gettime32(int ufd, |
|---|
| 567 | + struct old_itimerspec32 __user *otmr); |
|---|
| 568 | +asmlinkage long sys_timerfd_settime32(int ufd, int flags, |
|---|
| 569 | + const struct old_itimerspec32 __user *utmr, |
|---|
| 570 | + struct old_itimerspec32 __user *otmr); |
|---|
| 513 | 571 | |
|---|
| 514 | 572 | /* fs/utimes.c */ |
|---|
| 515 | 573 | asmlinkage long sys_utimensat(int dfd, const char __user *filename, |
|---|
| 516 | | - struct timespec __user *utimes, int flags); |
|---|
| 574 | + struct __kernel_timespec __user *utimes, |
|---|
| 575 | + int flags); |
|---|
| 576 | +asmlinkage long sys_utimensat_time32(unsigned int dfd, |
|---|
| 577 | + const char __user *filename, |
|---|
| 578 | + struct old_timespec32 __user *t, int flags); |
|---|
| 517 | 579 | |
|---|
| 518 | 580 | /* kernel/acct.c */ |
|---|
| 519 | 581 | asmlinkage long sys_acct(const char __user *name); |
|---|
| .. | .. |
|---|
| 540 | 602 | |
|---|
| 541 | 603 | /* kernel/futex.c */ |
|---|
| 542 | 604 | asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val, |
|---|
| 543 | | - struct timespec __user *utime, u32 __user *uaddr2, |
|---|
| 605 | + struct __kernel_timespec __user *utime, u32 __user *uaddr2, |
|---|
| 606 | + u32 val3); |
|---|
| 607 | +asmlinkage long sys_futex_time32(u32 __user *uaddr, int op, u32 val, |
|---|
| 608 | + struct old_timespec32 __user *utime, u32 __user *uaddr2, |
|---|
| 544 | 609 | u32 val3); |
|---|
| 545 | 610 | asmlinkage long sys_get_robust_list(int pid, |
|---|
| 546 | 611 | struct robust_list_head __user * __user *head_ptr, |
|---|
| .. | .. |
|---|
| 551 | 616 | /* kernel/hrtimer.c */ |
|---|
| 552 | 617 | asmlinkage long sys_nanosleep(struct __kernel_timespec __user *rqtp, |
|---|
| 553 | 618 | struct __kernel_timespec __user *rmtp); |
|---|
| 619 | +asmlinkage long sys_nanosleep_time32(struct old_timespec32 __user *rqtp, |
|---|
| 620 | + struct old_timespec32 __user *rmtp); |
|---|
| 554 | 621 | |
|---|
| 555 | 622 | /* kernel/itimer.c */ |
|---|
| 556 | | -asmlinkage long sys_getitimer(int which, struct itimerval __user *value); |
|---|
| 623 | +asmlinkage long sys_getitimer(int which, struct __kernel_old_itimerval __user *value); |
|---|
| 557 | 624 | asmlinkage long sys_setitimer(int which, |
|---|
| 558 | | - struct itimerval __user *value, |
|---|
| 559 | | - struct itimerval __user *ovalue); |
|---|
| 625 | + struct __kernel_old_itimerval __user *value, |
|---|
| 626 | + struct __kernel_old_itimerval __user *ovalue); |
|---|
| 560 | 627 | |
|---|
| 561 | 628 | /* kernel/kexec.c */ |
|---|
| 562 | 629 | asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, |
|---|
| .. | .. |
|---|
| 578 | 645 | asmlinkage long sys_timer_getoverrun(timer_t timer_id); |
|---|
| 579 | 646 | asmlinkage long sys_timer_settime(timer_t timer_id, int flags, |
|---|
| 580 | 647 | const struct __kernel_itimerspec __user *new_setting, |
|---|
| 581 | | - struct itimerspec __user *old_setting); |
|---|
| 648 | + struct __kernel_itimerspec __user *old_setting); |
|---|
| 582 | 649 | asmlinkage long sys_timer_delete(timer_t timer_id); |
|---|
| 583 | 650 | asmlinkage long sys_clock_settime(clockid_t which_clock, |
|---|
| 584 | 651 | const struct __kernel_timespec __user *tp); |
|---|
| .. | .. |
|---|
| 589 | 656 | asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags, |
|---|
| 590 | 657 | const struct __kernel_timespec __user *rqtp, |
|---|
| 591 | 658 | struct __kernel_timespec __user *rmtp); |
|---|
| 659 | +asmlinkage long sys_timer_gettime32(timer_t timer_id, |
|---|
| 660 | + struct old_itimerspec32 __user *setting); |
|---|
| 661 | +asmlinkage long sys_timer_settime32(timer_t timer_id, int flags, |
|---|
| 662 | + struct old_itimerspec32 __user *new, |
|---|
| 663 | + struct old_itimerspec32 __user *old); |
|---|
| 664 | +asmlinkage long sys_clock_settime32(clockid_t which_clock, |
|---|
| 665 | + struct old_timespec32 __user *tp); |
|---|
| 666 | +asmlinkage long sys_clock_gettime32(clockid_t which_clock, |
|---|
| 667 | + struct old_timespec32 __user *tp); |
|---|
| 668 | +asmlinkage long sys_clock_getres_time32(clockid_t which_clock, |
|---|
| 669 | + struct old_timespec32 __user *tp); |
|---|
| 670 | +asmlinkage long sys_clock_nanosleep_time32(clockid_t which_clock, int flags, |
|---|
| 671 | + struct old_timespec32 __user *rqtp, |
|---|
| 672 | + struct old_timespec32 __user *rmtp); |
|---|
| 592 | 673 | |
|---|
| 593 | 674 | /* kernel/printk.c */ |
|---|
| 594 | 675 | asmlinkage long sys_syslog(int type, char __user *buf, int len); |
|---|
| .. | .. |
|---|
| 613 | 694 | asmlinkage long sys_sched_get_priority_max(int policy); |
|---|
| 614 | 695 | asmlinkage long sys_sched_get_priority_min(int policy); |
|---|
| 615 | 696 | asmlinkage long sys_sched_rr_get_interval(pid_t pid, |
|---|
| 616 | | - struct timespec __user *interval); |
|---|
| 697 | + struct __kernel_timespec __user *interval); |
|---|
| 698 | +asmlinkage long sys_sched_rr_get_interval_time32(pid_t pid, |
|---|
| 699 | + struct old_timespec32 __user *interval); |
|---|
| 617 | 700 | |
|---|
| 618 | 701 | /* kernel/signal.c */ |
|---|
| 619 | 702 | asmlinkage long sys_restart_syscall(void); |
|---|
| .. | .. |
|---|
| 634 | 717 | asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize); |
|---|
| 635 | 718 | asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese, |
|---|
| 636 | 719 | siginfo_t __user *uinfo, |
|---|
| 637 | | - const struct timespec __user *uts, |
|---|
| 720 | + const struct __kernel_timespec __user *uts, |
|---|
| 721 | + size_t sigsetsize); |
|---|
| 722 | +asmlinkage long sys_rt_sigtimedwait_time32(const sigset_t __user *uthese, |
|---|
| 723 | + siginfo_t __user *uinfo, |
|---|
| 724 | + const struct old_timespec32 __user *uts, |
|---|
| 638 | 725 | size_t sigsetsize); |
|---|
| 639 | 726 | asmlinkage long sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo); |
|---|
| 640 | 727 | |
|---|
| .. | .. |
|---|
| 674 | 761 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); |
|---|
| 675 | 762 | |
|---|
| 676 | 763 | /* kernel/time.c */ |
|---|
| 677 | | -asmlinkage long sys_gettimeofday(struct timeval __user *tv, |
|---|
| 764 | +asmlinkage long sys_gettimeofday(struct __kernel_old_timeval __user *tv, |
|---|
| 678 | 765 | struct timezone __user *tz); |
|---|
| 679 | | -asmlinkage long sys_settimeofday(struct timeval __user *tv, |
|---|
| 766 | +asmlinkage long sys_settimeofday(struct __kernel_old_timeval __user *tv, |
|---|
| 680 | 767 | struct timezone __user *tz); |
|---|
| 681 | | -asmlinkage long sys_adjtimex(struct timex __user *txc_p); |
|---|
| 768 | +asmlinkage long sys_adjtimex(struct __kernel_timex __user *txc_p); |
|---|
| 769 | +asmlinkage long sys_adjtimex_time32(struct old_timex32 __user *txc_p); |
|---|
| 682 | 770 | |
|---|
| 683 | 771 | /* kernel/timer.c */ |
|---|
| 684 | 772 | asmlinkage long sys_getpid(void); |
|---|
| .. | .. |
|---|
| 697 | 785 | asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct __kernel_timespec __user *abs_timeout); |
|---|
| 698 | 786 | asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); |
|---|
| 699 | 787 | asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); |
|---|
| 788 | +asmlinkage long sys_mq_timedreceive_time32(mqd_t mqdes, |
|---|
| 789 | + char __user *u_msg_ptr, |
|---|
| 790 | + unsigned int msg_len, unsigned int __user *u_msg_prio, |
|---|
| 791 | + const struct old_timespec32 __user *u_abs_timeout); |
|---|
| 792 | +asmlinkage long sys_mq_timedsend_time32(mqd_t mqdes, |
|---|
| 793 | + const char __user *u_msg_ptr, |
|---|
| 794 | + unsigned int msg_len, unsigned int msg_prio, |
|---|
| 795 | + const struct old_timespec32 __user *u_abs_timeout); |
|---|
| 700 | 796 | |
|---|
| 701 | 797 | /* ipc/msg.c */ |
|---|
| 702 | 798 | asmlinkage long sys_msgget(key_t key, int msgflg); |
|---|
| 799 | +asmlinkage long sys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf); |
|---|
| 703 | 800 | asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf); |
|---|
| 704 | 801 | asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp, |
|---|
| 705 | 802 | size_t msgsz, long msgtyp, int msgflg); |
|---|
| .. | .. |
|---|
| 709 | 806 | /* ipc/sem.c */ |
|---|
| 710 | 807 | asmlinkage long sys_semget(key_t key, int nsems, int semflg); |
|---|
| 711 | 808 | asmlinkage long sys_semctl(int semid, int semnum, int cmd, unsigned long arg); |
|---|
| 809 | +asmlinkage long sys_old_semctl(int semid, int semnum, int cmd, unsigned long arg); |
|---|
| 712 | 810 | asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops, |
|---|
| 713 | 811 | unsigned nsops, |
|---|
| 714 | 812 | const struct __kernel_timespec __user *timeout); |
|---|
| 813 | +asmlinkage long sys_semtimedop_time32(int semid, struct sembuf __user *sops, |
|---|
| 814 | + unsigned nsops, |
|---|
| 815 | + const struct old_timespec32 __user *timeout); |
|---|
| 715 | 816 | asmlinkage long sys_semop(int semid, struct sembuf __user *sops, |
|---|
| 716 | 817 | unsigned nsops); |
|---|
| 717 | 818 | |
|---|
| 718 | 819 | /* ipc/shm.c */ |
|---|
| 719 | 820 | asmlinkage long sys_shmget(key_t key, size_t size, int flag); |
|---|
| 821 | +asmlinkage long sys_old_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); |
|---|
| 720 | 822 | asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); |
|---|
| 721 | 823 | asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg); |
|---|
| 722 | 824 | asmlinkage long sys_shmdt(char __user *shmaddr); |
|---|
| .. | .. |
|---|
| 778 | 880 | int __user *, unsigned long); |
|---|
| 779 | 881 | #endif |
|---|
| 780 | 882 | #endif |
|---|
| 883 | + |
|---|
| 884 | +asmlinkage long sys_clone3(struct clone_args __user *uargs, size_t size); |
|---|
| 885 | + |
|---|
| 781 | 886 | asmlinkage long sys_execve(const char __user *filename, |
|---|
| 782 | 887 | const char __user *const __user *argv, |
|---|
| 783 | 888 | const char __user *const __user *envp); |
|---|
| .. | .. |
|---|
| 798 | 903 | asmlinkage long sys_mincore(unsigned long start, size_t len, |
|---|
| 799 | 904 | unsigned char __user * vec); |
|---|
| 800 | 905 | asmlinkage long sys_madvise(unsigned long start, size_t len, int behavior); |
|---|
| 906 | +asmlinkage long sys_process_madvise(int pidfd, const struct iovec __user *vec, |
|---|
| 907 | + size_t vlen, int behavior, unsigned int flags); |
|---|
| 908 | +asmlinkage long sys_process_mrelease(int pidfd, unsigned int flags); |
|---|
| 801 | 909 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, |
|---|
| 802 | 910 | unsigned long prot, unsigned long pgoff, |
|---|
| 803 | 911 | unsigned long flags); |
|---|
| .. | .. |
|---|
| 829 | 937 | asmlinkage long sys_accept4(int, struct sockaddr __user *, int __user *, int); |
|---|
| 830 | 938 | asmlinkage long sys_recvmmsg(int fd, struct mmsghdr __user *msg, |
|---|
| 831 | 939 | unsigned int vlen, unsigned flags, |
|---|
| 832 | | - struct timespec __user *timeout); |
|---|
| 940 | + struct __kernel_timespec __user *timeout); |
|---|
| 941 | +asmlinkage long sys_recvmmsg_time32(int fd, struct mmsghdr __user *msg, |
|---|
| 942 | + unsigned int vlen, unsigned flags, |
|---|
| 943 | + struct old_timespec32 __user *timeout); |
|---|
| 833 | 944 | |
|---|
| 834 | 945 | asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr, |
|---|
| 835 | 946 | int options, struct rusage __user *ru); |
|---|
| .. | .. |
|---|
| 847 | 958 | struct file_handle __user *handle, |
|---|
| 848 | 959 | int flags); |
|---|
| 849 | 960 | asmlinkage long sys_clock_adjtime(clockid_t which_clock, |
|---|
| 850 | | - struct timex __user *tx); |
|---|
| 961 | + struct __kernel_timex __user *tx); |
|---|
| 962 | +asmlinkage long sys_clock_adjtime32(clockid_t which_clock, |
|---|
| 963 | + struct old_timex32 __user *tx); |
|---|
| 851 | 964 | asmlinkage long sys_syncfs(int fd); |
|---|
| 852 | 965 | asmlinkage long sys_setns(int fd, int nstype); |
|---|
| 853 | 966 | asmlinkage long sys_pidfd_open(pid_t pid, unsigned int flags); |
|---|
| .. | .. |
|---|
| 879 | 992 | int newdfd, const char __user *newname, |
|---|
| 880 | 993 | unsigned int flags); |
|---|
| 881 | 994 | asmlinkage long sys_seccomp(unsigned int op, unsigned int flags, |
|---|
| 882 | | - const char __user *uargs); |
|---|
| 995 | + void __user *uargs); |
|---|
| 883 | 996 | asmlinkage long sys_getrandom(char __user *buf, size_t count, |
|---|
| 884 | 997 | unsigned int flags); |
|---|
| 885 | 998 | asmlinkage long sys_memfd_create(const char __user *uname_ptr, unsigned int flags); |
|---|
| .. | .. |
|---|
| 888 | 1001 | const char __user *const __user *argv, |
|---|
| 889 | 1002 | const char __user *const __user *envp, int flags); |
|---|
| 890 | 1003 | asmlinkage long sys_userfaultfd(int flags); |
|---|
| 891 | | -asmlinkage long sys_membarrier(int cmd, int flags); |
|---|
| 1004 | +asmlinkage long sys_membarrier(int cmd, unsigned int flags, int cpu_id); |
|---|
| 892 | 1005 | asmlinkage long sys_mlock2(unsigned long start, size_t len, int flags); |
|---|
| 893 | 1006 | asmlinkage long sys_copy_file_range(int fd_in, loff_t __user *off_in, |
|---|
| 894 | 1007 | int fd_out, loff_t __user *off_out, |
|---|
| .. | .. |
|---|
| 907 | 1020 | unsigned mask, struct statx __user *buffer); |
|---|
| 908 | 1021 | asmlinkage long sys_rseq(struct rseq __user *rseq, uint32_t rseq_len, |
|---|
| 909 | 1022 | int flags, uint32_t sig); |
|---|
| 1023 | +asmlinkage long sys_open_tree(int dfd, const char __user *path, unsigned flags); |
|---|
| 1024 | +asmlinkage long sys_move_mount(int from_dfd, const char __user *from_path, |
|---|
| 1025 | + int to_dfd, const char __user *to_path, |
|---|
| 1026 | + unsigned int ms_flags); |
|---|
| 1027 | +asmlinkage long sys_fsopen(const char __user *fs_name, unsigned int flags); |
|---|
| 1028 | +asmlinkage long sys_fsconfig(int fs_fd, unsigned int cmd, const char __user *key, |
|---|
| 1029 | + const void __user *value, int aux); |
|---|
| 1030 | +asmlinkage long sys_fsmount(int fs_fd, unsigned int flags, unsigned int ms_flags); |
|---|
| 1031 | +asmlinkage long sys_fspick(int dfd, const char __user *path, unsigned int flags); |
|---|
| 910 | 1032 | asmlinkage long sys_pidfd_send_signal(int pidfd, int sig, |
|---|
| 911 | 1033 | siginfo_t __user *info, |
|---|
| 912 | 1034 | unsigned int flags); |
|---|
| 1035 | +asmlinkage long sys_pidfd_getfd(int pidfd, int fd, unsigned int flags); |
|---|
| 913 | 1036 | |
|---|
| 914 | 1037 | /* |
|---|
| 915 | 1038 | * Architecture-specific system calls |
|---|
| .. | .. |
|---|
| 958 | 1081 | asmlinkage long sys_rename(const char __user *oldname, |
|---|
| 959 | 1082 | const char __user *newname); |
|---|
| 960 | 1083 | asmlinkage long sys_symlink(const char __user *old, const char __user *new); |
|---|
| 961 | | -asmlinkage long sys_utimes(char __user *filename, |
|---|
| 962 | | - struct timeval __user *utimes); |
|---|
| 963 | 1084 | #if defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_COMPAT_STAT64) |
|---|
| 964 | 1085 | asmlinkage long sys_stat64(const char __user *filename, |
|---|
| 965 | 1086 | struct stat64 __user *statbuf); |
|---|
| .. | .. |
|---|
| 988 | 1109 | asmlinkage long sys_alarm(unsigned int seconds); |
|---|
| 989 | 1110 | asmlinkage long sys_getpgrp(void); |
|---|
| 990 | 1111 | asmlinkage long sys_pause(void); |
|---|
| 991 | | -asmlinkage long sys_time(time_t __user *tloc); |
|---|
| 1112 | +asmlinkage long sys_time(__kernel_old_time_t __user *tloc); |
|---|
| 1113 | +asmlinkage long sys_time32(old_time32_t __user *tloc); |
|---|
| 1114 | +#ifdef __ARCH_WANT_SYS_UTIME |
|---|
| 992 | 1115 | asmlinkage long sys_utime(char __user *filename, |
|---|
| 993 | 1116 | struct utimbuf __user *times); |
|---|
| 1117 | +asmlinkage long sys_utimes(char __user *filename, |
|---|
| 1118 | + struct __kernel_old_timeval __user *utimes); |
|---|
| 1119 | +asmlinkage long sys_futimesat(int dfd, const char __user *filename, |
|---|
| 1120 | + struct __kernel_old_timeval __user *utimes); |
|---|
| 1121 | +#endif |
|---|
| 1122 | +asmlinkage long sys_futimesat_time32(unsigned int dfd, |
|---|
| 1123 | + const char __user *filename, |
|---|
| 1124 | + struct old_timeval32 __user *t); |
|---|
| 1125 | +asmlinkage long sys_utime32(const char __user *filename, |
|---|
| 1126 | + struct old_utimbuf32 __user *t); |
|---|
| 1127 | +asmlinkage long sys_utimes_time32(const char __user *filename, |
|---|
| 1128 | + struct old_timeval32 __user *t); |
|---|
| 994 | 1129 | asmlinkage long sys_creat(const char __user *pathname, umode_t mode); |
|---|
| 995 | 1130 | asmlinkage long sys_getdents(unsigned int fd, |
|---|
| 996 | 1131 | struct linux_dirent __user *dirent, |
|---|
| 997 | 1132 | unsigned int count); |
|---|
| 998 | | -asmlinkage long sys_futimesat(int dfd, const char __user *filename, |
|---|
| 999 | | - struct timeval __user *utimes); |
|---|
| 1000 | 1133 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, |
|---|
| 1001 | | - fd_set __user *exp, struct timeval __user *tvp); |
|---|
| 1134 | + fd_set __user *exp, struct __kernel_old_timeval __user *tvp); |
|---|
| 1002 | 1135 | asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, |
|---|
| 1003 | 1136 | int timeout); |
|---|
| 1004 | 1137 | asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, |
|---|
| .. | .. |
|---|
| 1010 | 1143 | asmlinkage long sys_bdflush(int func, long data); |
|---|
| 1011 | 1144 | asmlinkage long sys_oldumount(char __user *name); |
|---|
| 1012 | 1145 | asmlinkage long sys_uselib(const char __user *library); |
|---|
| 1013 | | -asmlinkage long sys_sysctl(struct __sysctl_args __user *args); |
|---|
| 1014 | 1146 | asmlinkage long sys_sysfs(int option, |
|---|
| 1015 | 1147 | unsigned long arg1, unsigned long arg2); |
|---|
| 1016 | 1148 | asmlinkage long sys_fork(void); |
|---|
| 1017 | 1149 | |
|---|
| 1018 | 1150 | /* obsolete: kernel/time/time.c */ |
|---|
| 1019 | | -asmlinkage long sys_stime(time_t __user *tptr); |
|---|
| 1151 | +asmlinkage long sys_stime(__kernel_old_time_t __user *tptr); |
|---|
| 1152 | +asmlinkage long sys_stime32(old_time32_t __user *tptr); |
|---|
| 1020 | 1153 | |
|---|
| 1021 | 1154 | /* obsolete: kernel/signal.c */ |
|---|
| 1022 | 1155 | asmlinkage long sys_sigpending(old_sigset_t __user *uset); |
|---|
| .. | .. |
|---|
| 1129 | 1262 | * Instead, use one of the functions which work equivalently, such as |
|---|
| 1130 | 1263 | * the ksys_xyzyyz() functions prototyped below. |
|---|
| 1131 | 1264 | */ |
|---|
| 1132 | | - |
|---|
| 1133 | | -int ksys_mount(char __user *dev_name, char __user *dir_name, char __user *type, |
|---|
| 1134 | | - unsigned long flags, void __user *data); |
|---|
| 1135 | | -int ksys_umount(char __user *name, int flags); |
|---|
| 1136 | | -int ksys_dup(unsigned int fildes); |
|---|
| 1137 | | -int ksys_chroot(const char __user *filename); |
|---|
| 1138 | 1265 | ssize_t ksys_write(unsigned int fd, const char __user *buf, size_t count); |
|---|
| 1139 | | -int ksys_chdir(const char __user *filename); |
|---|
| 1140 | | -int ksys_fchmod(unsigned int fd, umode_t mode); |
|---|
| 1141 | 1266 | int ksys_fchown(unsigned int fd, uid_t user, gid_t group); |
|---|
| 1142 | | -int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent, |
|---|
| 1143 | | - unsigned int count); |
|---|
| 1144 | | -int ksys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); |
|---|
| 1145 | | -off_t ksys_lseek(unsigned int fd, off_t offset, unsigned int whence); |
|---|
| 1146 | 1267 | ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count); |
|---|
| 1147 | 1268 | void ksys_sync(void); |
|---|
| 1148 | 1269 | int ksys_unshare(unsigned long unshare_flags); |
|---|
| .. | .. |
|---|
| 1167 | 1288 | unsigned long prot, unsigned long flags, |
|---|
| 1168 | 1289 | unsigned long fd, unsigned long pgoff); |
|---|
| 1169 | 1290 | ssize_t ksys_readahead(int fd, loff_t offset, size_t count); |
|---|
| 1291 | +int ksys_ipc(unsigned int call, int first, unsigned long second, |
|---|
| 1292 | + unsigned long third, void __user * ptr, long fifth); |
|---|
| 1293 | +int compat_ksys_ipc(u32 call, int first, int second, |
|---|
| 1294 | + u32 third, u32 ptr, u32 fifth); |
|---|
| 1170 | 1295 | |
|---|
| 1171 | 1296 | /* |
|---|
| 1172 | 1297 | * The following kernel syscall equivalents are just wrappers to fs-internal |
|---|
| 1173 | 1298 | * functions. Therefore, provide stubs to be inlined at the callsites. |
|---|
| 1174 | 1299 | */ |
|---|
| 1175 | | -extern long do_unlinkat(int dfd, struct filename *name); |
|---|
| 1176 | | - |
|---|
| 1177 | | -static inline long ksys_unlink(const char __user *pathname) |
|---|
| 1178 | | -{ |
|---|
| 1179 | | - return do_unlinkat(AT_FDCWD, getname(pathname)); |
|---|
| 1180 | | -} |
|---|
| 1181 | | - |
|---|
| 1182 | | -extern long do_rmdir(int dfd, const char __user *pathname); |
|---|
| 1183 | | - |
|---|
| 1184 | | -static inline long ksys_rmdir(const char __user *pathname) |
|---|
| 1185 | | -{ |
|---|
| 1186 | | - return do_rmdir(AT_FDCWD, pathname); |
|---|
| 1187 | | -} |
|---|
| 1188 | | - |
|---|
| 1189 | | -extern long do_mkdirat(int dfd, const char __user *pathname, umode_t mode); |
|---|
| 1190 | | - |
|---|
| 1191 | | -static inline long ksys_mkdir(const char __user *pathname, umode_t mode) |
|---|
| 1192 | | -{ |
|---|
| 1193 | | - return do_mkdirat(AT_FDCWD, pathname, mode); |
|---|
| 1194 | | -} |
|---|
| 1195 | | - |
|---|
| 1196 | | -extern long do_symlinkat(const char __user *oldname, int newdfd, |
|---|
| 1197 | | - const char __user *newname); |
|---|
| 1198 | | - |
|---|
| 1199 | | -static inline long ksys_symlink(const char __user *oldname, |
|---|
| 1200 | | - const char __user *newname) |
|---|
| 1201 | | -{ |
|---|
| 1202 | | - return do_symlinkat(oldname, AT_FDCWD, newname); |
|---|
| 1203 | | -} |
|---|
| 1204 | | - |
|---|
| 1205 | | -extern long do_mknodat(int dfd, const char __user *filename, umode_t mode, |
|---|
| 1206 | | - unsigned int dev); |
|---|
| 1207 | | - |
|---|
| 1208 | | -static inline long ksys_mknod(const char __user *filename, umode_t mode, |
|---|
| 1209 | | - unsigned int dev) |
|---|
| 1210 | | -{ |
|---|
| 1211 | | - return do_mknodat(AT_FDCWD, filename, mode, dev); |
|---|
| 1212 | | -} |
|---|
| 1213 | | - |
|---|
| 1214 | | -extern int do_linkat(int olddfd, const char __user *oldname, int newdfd, |
|---|
| 1215 | | - const char __user *newname, int flags); |
|---|
| 1216 | | - |
|---|
| 1217 | | -static inline long ksys_link(const char __user *oldname, |
|---|
| 1218 | | - const char __user *newname) |
|---|
| 1219 | | -{ |
|---|
| 1220 | | - return do_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0); |
|---|
| 1221 | | -} |
|---|
| 1222 | | - |
|---|
| 1223 | | -extern int do_fchmodat(int dfd, const char __user *filename, umode_t mode); |
|---|
| 1224 | | - |
|---|
| 1225 | | -static inline int ksys_chmod(const char __user *filename, umode_t mode) |
|---|
| 1226 | | -{ |
|---|
| 1227 | | - return do_fchmodat(AT_FDCWD, filename, mode); |
|---|
| 1228 | | -} |
|---|
| 1229 | | - |
|---|
| 1230 | | -extern long do_faccessat(int dfd, const char __user *filename, int mode); |
|---|
| 1231 | | - |
|---|
| 1232 | | -static inline long ksys_access(const char __user *filename, int mode) |
|---|
| 1233 | | -{ |
|---|
| 1234 | | - return do_faccessat(AT_FDCWD, filename, mode); |
|---|
| 1235 | | -} |
|---|
| 1236 | | - |
|---|
| 1237 | 1300 | extern int do_fchownat(int dfd, const char __user *filename, uid_t user, |
|---|
| 1238 | 1301 | gid_t group, int flag); |
|---|
| 1239 | 1302 | |
|---|
| .. | .. |
|---|
| 1252 | 1315 | |
|---|
| 1253 | 1316 | extern long do_sys_ftruncate(unsigned int fd, loff_t length, int small); |
|---|
| 1254 | 1317 | |
|---|
| 1255 | | -static inline long ksys_ftruncate(unsigned int fd, unsigned long length) |
|---|
| 1318 | +static inline long ksys_ftruncate(unsigned int fd, loff_t length) |
|---|
| 1256 | 1319 | { |
|---|
| 1257 | 1320 | return do_sys_ftruncate(fd, length, 1); |
|---|
| 1258 | 1321 | } |
|---|
| .. | .. |
|---|
| 1267 | 1330 | static inline int ksys_close(unsigned int fd) |
|---|
| 1268 | 1331 | { |
|---|
| 1269 | 1332 | return __close_fd(current->files, fd); |
|---|
| 1270 | | -} |
|---|
| 1271 | | - |
|---|
| 1272 | | -extern long do_sys_open(int dfd, const char __user *filename, int flags, |
|---|
| 1273 | | - umode_t mode); |
|---|
| 1274 | | - |
|---|
| 1275 | | -static inline long ksys_open(const char __user *filename, int flags, |
|---|
| 1276 | | - umode_t mode) |
|---|
| 1277 | | -{ |
|---|
| 1278 | | - if (force_o_largefile()) |
|---|
| 1279 | | - flags |= O_LARGEFILE; |
|---|
| 1280 | | - return do_sys_open(AT_FDCWD, filename, flags, mode); |
|---|
| 1281 | 1333 | } |
|---|
| 1282 | 1334 | |
|---|
| 1283 | 1335 | extern long do_sys_truncate(const char __user *pathname, loff_t length); |
|---|
| .. | .. |
|---|
| 1297 | 1349 | return old; |
|---|
| 1298 | 1350 | } |
|---|
| 1299 | 1351 | |
|---|
| 1352 | +/* for __ARCH_WANT_SYS_IPC */ |
|---|
| 1353 | +long ksys_semtimedop(int semid, struct sembuf __user *tsops, |
|---|
| 1354 | + unsigned int nsops, |
|---|
| 1355 | + const struct __kernel_timespec __user *timeout); |
|---|
| 1356 | +long ksys_semget(key_t key, int nsems, int semflg); |
|---|
| 1357 | +long ksys_old_semctl(int semid, int semnum, int cmd, unsigned long arg); |
|---|
| 1358 | +long ksys_msgget(key_t key, int msgflg); |
|---|
| 1359 | +long ksys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf); |
|---|
| 1360 | +long ksys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz, |
|---|
| 1361 | + long msgtyp, int msgflg); |
|---|
| 1362 | +long ksys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz, |
|---|
| 1363 | + int msgflg); |
|---|
| 1364 | +long ksys_shmget(key_t key, size_t size, int shmflg); |
|---|
| 1365 | +long ksys_shmdt(char __user *shmaddr); |
|---|
| 1366 | +long ksys_old_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); |
|---|
| 1367 | +long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems, |
|---|
| 1368 | + unsigned int nsops, |
|---|
| 1369 | + const struct old_timespec32 __user *timeout); |
|---|
| 1370 | + |
|---|
| 1371 | +int __sys_getsockopt(int fd, int level, int optname, char __user *optval, |
|---|
| 1372 | + int __user *optlen); |
|---|
| 1373 | +int __sys_setsockopt(int fd, int level, int optname, char __user *optval, |
|---|
| 1374 | + int optlen); |
|---|
| 1300 | 1375 | #endif |
|---|