Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/arch/arc/include/uapi/asm/unistd.h b/arch/arc/include/uapi/asm/unistd.h
- index fa2713ae6bea..73eb97110757 100644
- --- a/arch/arc/include/uapi/asm/unistd.h
- +++ b/arch/arc/include/uapi/asm/unistd.h
- @@ -26,8 +26,6 @@
- #define __ARCH_WANT_SYS_FORK
- #define __ARCH_WANT_TIME32_SYSCALLS
- -#define sys_mmap2 sys_mmap_pgoff
- -
- #include <asm-generic/unistd.h>
- #define NR_syscalls __NR_syscalls
- diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
- index a4dbac07e4ef..bc7884b0736f 100644
- --- a/arch/arm/include/asm/ftrace.h
- +++ b/arch/arm/include/asm/ftrace.h
- @@ -60,9 +60,7 @@ static inline void *return_address(unsigned int level)
- static inline bool arch_syscall_match_sym_name(const char *sym,
- const char *name)
- {
- - if (!strcmp(sym, "sys_mmap2"))
- - sym = "sys_mmap_pgoff";
- - else if (!strcmp(sym, "sys_statfs64_wrapper"))
- + if (!strcmp(sym, "sys_statfs64_wrapper"))
- sym = "sys_statfs64";
- else if (!strcmp(sym, "sys_fstatfs64_wrapper"))
- sym = "sys_fstatfs64";
- diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
- index 67a89e598f9e..09d723635b85 100644
- --- a/arch/arm/kernel/entry-common.S
- +++ b/arch/arm/kernel/entry-common.S
- @@ -400,15 +400,6 @@ sys_fstatfs64_wrapper:
- b sys_fstatfs64
- ENDPROC(sys_fstatfs64_wrapper)
- -/*
- - * Note: off_4k (r5) is always units of 4K. If we can't do the requested
- - * offset, we return EINVAL.
- - */
- -sys_mmap2:
- - str r5, [sp, #4]
- - b sys_mmap_pgoff
- -ENDPROC(sys_mmap2)
- -
- #ifdef CONFIG_OABI_COMPAT
- /*
- diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
- index 604a2053d006..7a8b8480113a 100644
- --- a/arch/arm64/include/asm/unistd32.h
- +++ b/arch/arm64/include/asm/unistd32.h
- @@ -395,7 +395,7 @@ __SYSCALL(__NR_vfork, sys_vfork)
- #define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
- __SYSCALL(__NR_ugetrlimit, compat_sys_getrlimit) /* SuS compliant getrlimit */
- #define __NR_mmap2 192
- -__SYSCALL(__NR_mmap2, compat_sys_aarch32_mmap2)
- +__SYSCALL(__NR_mmap2, sys_mmap2)
- #define __NR_truncate64 193
- __SYSCALL(__NR_truncate64, compat_sys_aarch32_truncate64)
- #define __NR_ftruncate64 194
- diff --git a/arch/arm64/kernel/sys32.c b/arch/arm64/kernel/sys32.c
- index a64c3d9fec2c..8f6fbffb0390 100644
- --- a/arch/arm64/kernel/sys32.c
- +++ b/arch/arm64/kernel/sys32.c
- @@ -48,22 +48,6 @@ COMPAT_SYSCALL_DEFINE3(aarch32_fstatfs64, unsigned int, fd, compat_size_t, sz,
- return kcompat_sys_fstatfs64(fd, sz, buf);
- }
- -/*
- - * Note: off_4k is always in units of 4K. If we can't do the
- - * requested offset because it is not page-aligned, we return -EINVAL.
- - */
- -COMPAT_SYSCALL_DEFINE6(aarch32_mmap2, unsigned long, addr, unsigned long, len,
- - unsigned long, prot, unsigned long, flags,
- - unsigned long, fd, unsigned long, off_4k)
- -{
- - if (off_4k & (~PAGE_MASK >> 12))
- - return -EINVAL;
- -
- - off_4k >>= (PAGE_SHIFT - 12);
- -
- - return ksys_mmap_pgoff(addr, len, prot, flags, fd, off_4k);
- -}
- -
- #ifdef CONFIG_CPU_BIG_ENDIAN
- #define arg_u32p(name) u32, name##_hi, u32, name##_lo
- #else
- diff --git a/arch/csky/kernel/syscall.c b/arch/csky/kernel/syscall.c
- index 3d30e58a45d2..ecde99520fd1 100644
- --- a/arch/csky/kernel/syscall.c
- +++ b/arch/csky/kernel/syscall.c
- @@ -14,21 +14,6 @@ SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
- return 0;
- }
- -SYSCALL_DEFINE6(mmap2,
- - unsigned long, addr,
- - unsigned long, len,
- - unsigned long, prot,
- - unsigned long, flags,
- - unsigned long, fd,
- - off_t, offset)
- -{
- - if (unlikely(offset & (~PAGE_MASK >> 12)))
- - return -EINVAL;
- -
- - return ksys_mmap_pgoff(addr, len, prot, flags, fd,
- - offset >> (PAGE_SHIFT - 12));
- -}
- -
- /*
- * for abiv1 the 64bits args should be even th, So we need mov the advice
- * forward.
- diff --git a/arch/h8300/kernel/syscalls.c b/arch/h8300/kernel/syscalls.c
- index 9022036fb3d2..7b9620dd314d 100644
- --- a/arch/h8300/kernel/syscalls.c
- +++ b/arch/h8300/kernel/syscalls.c
- @@ -6,8 +6,6 @@
- #undef __SYSCALL
- #define __SYSCALL(nr, call) [nr] = (call),
- -#define sys_mmap2 sys_mmap_pgoff
- -
- asmlinkage int sys_rt_sigreturn(void);
- void *_sys_call_table[__NR_syscalls] = {
- diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h
- index 432c4db1b623..37e1dcced3ca 100644
- --- a/arch/hexagon/include/uapi/asm/unistd.h
- +++ b/arch/hexagon/include/uapi/asm/unistd.h
- @@ -27,7 +27,6 @@
- * See also: syscalltab.c
- */
- -#define sys_mmap2 sys_mmap_pgoff
- #define __ARCH_WANT_RENAMEAT
- #define __ARCH_WANT_STAT64
- #define __ARCH_WANT_SET_GET_RLIMIT
- diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
- index bd0274c7592e..406e742c5498 100644
- --- a/arch/m68k/kernel/sys_m68k.c
- +++ b/arch/m68k/kernel/sys_m68k.c
- @@ -37,18 +37,6 @@
- asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
- unsigned long error_code);
- -asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
- - unsigned long prot, unsigned long flags,
- - unsigned long fd, unsigned long pgoff)
- -{
- - /*
- - * This is wrong for sun3 - there PAGE_SIZE is 8Kb,
- - * so we need to shift the argument down by 1; m68k mmap64(3)
- - * (in libc) expects the last argument of mmap2 in 4Kb units.
- - */
- - return ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
- -}
- -
- /* Convert virtual (user) address VADDR to physical address PADDR */
- #define virt_to_phys_040(vaddr) \
- ({ \
- diff --git a/arch/m68k/kernel/syscalltable.S b/arch/m68k/kernel/syscalltable.S
- index e25ef4a9df30..6bc4abef94dc 100644
- --- a/arch/m68k/kernel/syscalltable.S
- +++ b/arch/m68k/kernel/syscalltable.S
- @@ -14,10 +14,6 @@
- #include <linux/linkage.h>
- -#ifndef CONFIG_MMU
- -#define sys_mmap2 sys_mmap_pgoff
- -#endif
- -
- #define __SYSCALL(nr, entry) .long entry
- .section .rodata
- ALIGN
- diff --git a/arch/microblaze/kernel/sys_microblaze.c b/arch/microblaze/kernel/sys_microblaze.c
- index ed9f34da1a2a..f322250c70f3 100644
- --- a/arch/microblaze/kernel/sys_microblaze.c
- +++ b/arch/microblaze/kernel/sys_microblaze.c
- @@ -42,14 +42,3 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
- return ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT);
- }
- -
- -SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
- - unsigned long, prot, unsigned long, flags, unsigned long, fd,
- - unsigned long, pgoff)
- -{
- - if (pgoff & (~PAGE_MASK >> 12))
- - return -EINVAL;
- -
- - return ksys_mmap_pgoff(addr, len, prot, flags, fd,
- - pgoff >> (PAGE_SHIFT - 12));
- -}
- diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
- index 5512cd586e6e..c8d62e451675 100644
- --- a/arch/mips/kernel/syscall.c
- +++ b/arch/mips/kernel/syscall.c
- @@ -68,17 +68,6 @@ SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len,
- offset >> PAGE_SHIFT);
- }
- -SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,
- - unsigned long, prot, unsigned long, flags, unsigned long, fd,
- - unsigned long, pgoff)
- -{
- - if (pgoff & (~PAGE_MASK >> 12))
- - return -EINVAL;
- -
- - return ksys_mmap_pgoff(addr, len, prot, flags, fd,
- - pgoff >> (PAGE_SHIFT - 12));
- -}
- -
- save_static_function(sys_fork);
- save_static_function(sys_clone);
- save_static_function(sys_clone3);
- diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl
- index 8f243e35a7b2..60e4414a6966 100644
- --- a/arch/mips/kernel/syscalls/syscall_o32.tbl
- +++ b/arch/mips/kernel/syscalls/syscall_o32.tbl
- @@ -221,7 +221,7 @@
- 207 o32 sendfile sys_sendfile compat_sys_sendfile
- 208 o32 getpmsg sys_ni_syscall
- 209 o32 putpmsg sys_ni_syscall
- -210 o32 mmap2 sys_mips_mmap2
- +210 o32 mmap2 sys_mmap2
- 211 o32 truncate64 sys_truncate64 sys_32_truncate64
- 212 o32 ftruncate64 sys_ftruncate64 sys_32_ftruncate64
- 213 o32 stat64 sys_stat64 sys_newstat
- diff --git a/arch/nds32/kernel/sys_nds32.c b/arch/nds32/kernel/sys_nds32.c
- index cb2d1e219bb3..93f33b69f139 100644
- --- a/arch/nds32/kernel/sys_nds32.c
- +++ b/arch/nds32/kernel/sys_nds32.c
- @@ -9,17 +9,6 @@
- #include <asm/fpu.h>
- #include <asm/fp_udfiex_crtl.h>
- -SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
- - unsigned long, prot, unsigned long, flags,
- - unsigned long, fd, unsigned long, pgoff)
- -{
- - if (pgoff & (~PAGE_MASK >> 12))
- - return -EINVAL;
- -
- - return sys_mmap_pgoff(addr, len, prot, flags, fd,
- - pgoff >> (PAGE_SHIFT - 12));
- -}
- -
- SYSCALL_DEFINE4(fadvise64_64_wrapper,int, fd, int, advice, loff_t, offset,
- loff_t, len)
- {
- diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h
- index 0b4bb1d41b28..667612d3785d 100644
- --- a/arch/nios2/include/uapi/asm/unistd.h
- +++ b/arch/nios2/include/uapi/asm/unistd.h
- @@ -16,8 +16,6 @@
- *
- */
- - #define sys_mmap2 sys_mmap_pgoff
- -
- #define __ARCH_WANT_RENAMEAT
- #define __ARCH_WANT_STAT64
- #define __ARCH_WANT_SET_GET_RLIMIT
- diff --git a/arch/openrisc/include/uapi/asm/unistd.h b/arch/openrisc/include/uapi/asm/unistd.h
- index fae34c60fa88..b340f5b07a0c 100644
- --- a/arch/openrisc/include/uapi/asm/unistd.h
- +++ b/arch/openrisc/include/uapi/asm/unistd.h
- @@ -17,8 +17,6 @@
- * (at your option) any later version.
- */
- -#define sys_mmap2 sys_mmap_pgoff
- -
- #define __ARCH_WANT_RENAMEAT
- #define __ARCH_WANT_STAT64
- #define __ARCH_WANT_SET_GET_RLIMIT
- diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
- index 2b34294517a1..821724ef9302 100644
- --- a/arch/parisc/kernel/sys_parisc.c
- +++ b/arch/parisc/kernel/sys_parisc.c
- @@ -272,16 +272,6 @@ void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack)
- }
- -asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len,
- - unsigned long prot, unsigned long flags, unsigned long fd,
- - unsigned long pgoff)
- -{
- - /* Make sure the shift for mmap2 is constant (12), no matter what PAGE_SIZE
- - we have. */
- - return ksys_mmap_pgoff(addr, len, prot, flags, fd,
- - pgoff >> (PAGE_SHIFT - 12));
- -}
- -
- asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
- unsigned long prot, unsigned long flags, unsigned long fd,
- unsigned long offset)
- diff --git a/arch/powerpc/include/asm/syscalls.h b/arch/powerpc/include/asm/syscalls.h
- index 7ee66ae5444d..13727533fdd2 100644
- --- a/arch/powerpc/include/asm/syscalls.h
- +++ b/arch/powerpc/include/asm/syscalls.h
- @@ -13,17 +13,10 @@ struct rtas_args;
- asmlinkage long sys_mmap(unsigned long addr, size_t len,
- unsigned long prot, unsigned long flags,
- unsigned long fd, off_t offset);
- -asmlinkage long sys_mmap2(unsigned long addr, size_t len,
- - unsigned long prot, unsigned long flags,
- - unsigned long fd, unsigned long pgoff);
- asmlinkage long ppc64_personality(unsigned long personality);
- asmlinkage long sys_rtas(struct rtas_args __user *uargs);
- #ifdef CONFIG_COMPAT
- -unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
- - unsigned long prot, unsigned long flags,
- - unsigned long fd, unsigned long pgoff);
- -
- compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count,
- u32 reg6, u32 pos1, u32 pos2);
- diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
- index 16ff0399a257..62b9237d7066 100644
- --- a/arch/powerpc/kernel/sys_ppc32.c
- +++ b/arch/powerpc/kernel/sys_ppc32.c
- @@ -48,14 +48,6 @@
- #include <asm/syscalls.h>
- #include <asm/switch_to.h>
- -unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
- - unsigned long prot, unsigned long flags,
- - unsigned long fd, unsigned long pgoff)
- -{
- - /* This should remain 12 even if PAGE_SIZE changes */
- - return sys_mmap(addr, len, prot, flags, fd, pgoff << 12);
- -}
- -
- /*
- * long long munging:
- * The 32 bit ABI passes long longs in an odd even register pair.
- diff --git a/arch/sh/include/asm/syscalls.h b/arch/sh/include/asm/syscalls.h
- index 387105316d28..296b377a6b1a 100644
- --- a/arch/sh/include/asm/syscalls.h
- +++ b/arch/sh/include/asm/syscalls.h
- @@ -5,9 +5,6 @@
- asmlinkage int old_mmap(unsigned long addr, unsigned long len,
- unsigned long prot, unsigned long flags,
- int fd, unsigned long off);
- -asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
- - unsigned long prot, unsigned long flags,
- - unsigned long fd, unsigned long pgoff);
- #include <asm/syscalls_32.h>
- diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c
- index a5a7b33ed81a..45abd5e1246e 100644
- --- a/arch/sh/kernel/sys_sh.c
- +++ b/arch/sh/kernel/sys_sh.c
- @@ -38,22 +38,6 @@ asmlinkage int old_mmap(unsigned long addr, unsigned long len,
- return ksys_mmap_pgoff(addr, len, prot, flags, fd, off>>PAGE_SHIFT);
- }
- -asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
- - unsigned long prot, unsigned long flags,
- - unsigned long fd, unsigned long pgoff)
- -{
- - /*
- - * The shift for mmap2 is constant, regardless of PAGE_SIZE
- - * setting.
- - */
- - if (pgoff & ((1 << (PAGE_SHIFT - 12)) - 1))
- - return -EINVAL;
- -
- - pgoff >>= PAGE_SHIFT - 12;
- -
- - return ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
- -}
- -
- /* sys_cacheflush -- flush (part of) the processor cache. */
- asmlinkage int sys_cacheflush(unsigned long addr, unsigned long len, int op)
- {
- diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
- index 082a551897ed..0e4f27053384 100644
- --- a/arch/sparc/kernel/sys_sparc_32.c
- +++ b/arch/sparc/kernel/sys_sparc_32.c
- @@ -96,18 +96,6 @@ int sparc_mmap_check(unsigned long addr, unsigned long len)
- return 0;
- }
- -/* Linux version of mmap */
- -
- -SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
- - unsigned long, prot, unsigned long, flags, unsigned long, fd,
- - unsigned long, pgoff)
- -{
- - /* Make sure the shift for mmap2 is constant (12), no matter what PAGE_SIZE
- - we have. */
- - return ksys_mmap_pgoff(addr, len, prot, flags, fd,
- - pgoff >> (PAGE_SHIFT - 12));
- -}
- -
- SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
- unsigned long, prot, unsigned long, flags, unsigned long, fd,
- unsigned long, off)
- diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl
- index 320480a8db4f..a037b14d5b4f 100644
- --- a/arch/x86/entry/syscalls/syscall_32.tbl
- +++ b/arch/x86/entry/syscalls/syscall_32.tbl
- @@ -203,7 +203,7 @@
- 189 i386 putpmsg
- 190 i386 vfork sys_vfork
- 191 i386 ugetrlimit sys_getrlimit compat_sys_getrlimit
- -192 i386 mmap2 sys_mmap_pgoff
- +192 i386 mmap2 sys_mmap2
- 193 i386 truncate64 sys_ia32_truncate64
- 194 i386 ftruncate64 sys_ia32_ftruncate64
- 195 i386 stat64 sys_stat64 compat_sys_ia32_stat64
- diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl
- index 52c94ab5c205..6bf8789e2766 100644
- --- a/arch/xtensa/kernel/syscalls/syscall.tbl
- +++ b/arch/xtensa/kernel/syscalls/syscall.tbl
- @@ -89,7 +89,7 @@
- 78 common flistxattr sys_flistxattr
- 79 common fremovexattr sys_fremovexattr
- # File Map / Shared Memory Operations
- -80 common mmap2 sys_mmap_pgoff
- +80 common mmap2 sys_mmap2
- 81 common munmap sys_munmap
- 82 common mprotect sys_mprotect
- 83 common brk sys_brk
- diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
- index 2cf94280faae..f38caf079551 100644
- --- a/include/linux/syscalls.h
- +++ b/include/linux/syscalls.h
- @@ -1269,7 +1269,7 @@ asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
- unsigned long third, void __user *ptr, long fifth);
- /* obsolete: mm/ */
- -asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len,
- +asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
- unsigned long prot, unsigned long flags,
- unsigned long fd, unsigned long pgoff);
- asmlinkage long sys_old_mmap(struct mmap_arg_struct __user *arg);
- diff --git a/mm/mmap.c b/mm/mmap.c
- index 3f48d0928e6b..83c1798f8072 100644
- --- a/mm/mmap.c
- +++ b/mm/mmap.c
- @@ -1634,11 +1634,16 @@ unsigned long ksys_mmap_pgoff(unsigned long addr, unsigned long len,
- return retval;
- }
- -SYSCALL_DEFINE6(mmap_pgoff, unsigned long, addr, unsigned long, len,
- +SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
- unsigned long, prot, unsigned long, flags,
- - unsigned long, fd, unsigned long, pgoff)
- + unsigned long, fd, unsigned long, off_4k)
- {
- - return ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
- + if (off_4k & (~PAGE_MASK >> 12))
- + return -EINVAL;
- +
- + off_4k >>= (PAGE_SHIFT - 12);
- +
- + return ksys_mmap_pgoff(addr, len, prot, flags, fd, off_4k);
- }
- #ifdef __ARCH_WANT_SYS_OLD_MMAP
- diff --git a/tools/arch/arc/include/uapi/asm/unistd.h b/tools/arch/arc/include/uapi/asm/unistd.h
- index 5eafa1115162..fab6ae4b16c2 100644
- --- a/tools/arch/arc/include/uapi/asm/unistd.h
- +++ b/tools/arch/arc/include/uapi/asm/unistd.h
- @@ -25,8 +25,6 @@
- #define __ARCH_WANT_SYS_FORK
- #define __ARCH_WANT_TIME32_SYSCALLS
- -#define sys_mmap2 sys_mmap_pgoff
- -
- #include <asm-generic/unistd.h>
- #define NR_syscalls __NR_syscalls
- diff --git a/tools/arch/hexagon/include/uapi/asm/unistd.h b/tools/arch/hexagon/include/uapi/asm/unistd.h
- index 432c4db1b623..37e1dcced3ca 100644
- --- a/tools/arch/hexagon/include/uapi/asm/unistd.h
- +++ b/tools/arch/hexagon/include/uapi/asm/unistd.h
- @@ -27,7 +27,6 @@
- * See also: syscalltab.c
- */
- -#define sys_mmap2 sys_mmap_pgoff
- #define __ARCH_WANT_RENAMEAT
- #define __ARCH_WANT_STAT64
- #define __ARCH_WANT_SET_GET_RLIMIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement