fs: remove compat_sys_mount
authorChristoph Hellwig <hch@lst.de>
Thu, 17 Sep 2020 08:22:34 +0000 (10:22 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 23 Sep 2020 03:45:57 +0000 (23:45 -0400)
compat_sys_mount is identical to the regular sys_mount now, so remove it
and use the native version everywhere.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
17 files changed:
arch/arm64/include/asm/unistd32.h
arch/mips/kernel/syscalls/syscall_n32.tbl
arch/mips/kernel/syscalls/syscall_o32.tbl
arch/parisc/kernel/syscalls/syscall.tbl
arch/powerpc/kernel/syscalls/syscall.tbl
arch/s390/kernel/syscalls/syscall.tbl
arch/sparc/kernel/syscalls/syscall.tbl
arch/x86/entry/syscalls/syscall_32.tbl
fs/Makefile
fs/compat.c [deleted file]
fs/internal.h
fs/namespace.c
include/linux/compat.h
include/uapi/asm-generic/unistd.h
tools/include/uapi/asm-generic/unistd.h
tools/perf/arch/powerpc/entry/syscalls/syscall.tbl
tools/perf/arch/s390/entry/syscalls/syscall.tbl

index 734860ac7cf9d51bc5cba74c2f51209e72a2ca83..5fd095d6545022981e22bb91a8290066ba86ddc1 100644 (file)
@@ -53,7 +53,7 @@ __SYSCALL(__NR_lseek, compat_sys_lseek)
 #define __NR_getpid 20
 __SYSCALL(__NR_getpid, sys_getpid)
 #define __NR_mount 21
-__SYSCALL(__NR_mount, compat_sys_mount)
+__SYSCALL(__NR_mount, sys_mount)
                        /* 22 was sys_umount */
 __SYSCALL(22, sys_ni_syscall)
 #define __NR_setuid 23
index f9df9edb67a4077eea652097a5b3a50f6fa546ec..61fa9e7013cbc1b8e2db7a25398f6f3f077363aa 100644 (file)
 157    n32     sync                            sys_sync
 158    n32     acct                            sys_acct
 159    n32     settimeofday                    compat_sys_settimeofday
-160    n32     mount                           compat_sys_mount
+160    n32     mount                           sys_mount
 161    n32     umount2                         sys_umount
 162    n32     swapon                          sys_swapon
 163    n32     swapoff                         sys_swapoff
index 195b43cf27c84812e16b3214c9a9ea41de2d913a..b992e89be7ff8aa84dda2780aa2cd1343ea84de4 100644 (file)
@@ -29,7 +29,7 @@
 18     o32     unused18                        sys_ni_syscall
 19     o32     lseek                           sys_lseek
 20     o32     getpid                          sys_getpid
-21     o32     mount                           sys_mount                       compat_sys_mount
+21     o32     mount                           sys_mount
 22     o32     umount                          sys_oldumount
 23     o32     setuid                          sys_setuid
 24     o32     getuid                          sys_getuid
index def64d221cd4fb2e22fa541aa130198cc7a3fa9b..07efd978182feac1c66368962873726407652da0 100644 (file)
@@ -29,7 +29,7 @@
 18     common  stat                    sys_newstat                     compat_sys_newstat
 19     common  lseek                   sys_lseek                       compat_sys_lseek
 20     common  getpid                  sys_getpid
-21     common  mount                   sys_mount                       compat_sys_mount
+21     common  mount                   sys_mount
 22     common  bind                    sys_bind
 23     common  setuid                  sys_setuid
 24     common  getuid                  sys_getuid
index c2d737ff2e7bec276dfa2b68cf766de454c648c6..a36ad4fec73c19d54194d71ce32b85e5c945bd5f 100644 (file)
@@ -34,7 +34,7 @@
 18     spu     oldstat                         sys_ni_syscall
 19     common  lseek                           sys_lseek                       compat_sys_lseek
 20     common  getpid                          sys_getpid
-21     nospu   mount                           sys_mount                       compat_sys_mount
+21     nospu   mount                           sys_mount
 22     32      umount                          sys_oldumount
 22     64      umount                          sys_ni_syscall
 22     spu     umount                          sys_ni_syscall
index 10456bc936fb09d87afee4fae97fc75ac2ea0b06..4b803dfbee2be91dd475bcadff92710e8abd227f 100644 (file)
@@ -26,7 +26,7 @@
 16   32                lchown                  -                               sys_lchown16
 19   common    lseek                   sys_lseek                       compat_sys_lseek
 20   common    getpid                  sys_getpid                      sys_getpid
-21   common    mount                   sys_mount                       compat_sys_mount
+21   common    mount                   sys_mount                       sys_mount
 22   common    umount                  sys_oldumount                   sys_oldumount
 23   32                setuid                  -                               sys_setuid16
 24   32                getuid                  -                               sys_getuid16
index 4af114e84f2022157afdf7d6dc76c61fa2be4e34..d5ff798fa08f80b6149b1c1e4f6104a67dd8e7df 100644 (file)
 164    64      utrap_install           sys_utrap_install
 165    common  quotactl                sys_quotactl
 166    common  set_tid_address         sys_set_tid_address
-167    common  mount                   sys_mount                       compat_sys_mount
+167    common  mount                   sys_mount
 168    common  ustat                   sys_ustat                       compat_sys_ustat
 169    common  setxattr                sys_setxattr
 170    common  lsetxattr               sys_lsetxattr
index 9d11028736661bc5ed583eb7ed5e89c1c3ef2753..5a40b226fb7b7adae0d1fdec074b9a4802a88968 100644 (file)
@@ -32,7 +32,7 @@
 18     i386    oldstat                 sys_stat
 19     i386    lseek                   sys_lseek                       compat_sys_lseek
 20     i386    getpid                  sys_getpid
-21     i386    mount                   sys_mount                       compat_sys_mount
+21     i386    mount                   sys_mount
 22     i386    umount                  sys_oldumount
 23     i386    setuid                  sys_setuid16
 24     i386    getuid                  sys_getuid16
index 1c7b0e3f6daa111c7c0a43105754ea91e81064af..d72ee2ce7af0802d74032558d180e8f4540f2d2b 100644 (file)
@@ -37,7 +37,6 @@ obj-$(CONFIG_FS_DAX)          += dax.o
 obj-$(CONFIG_FS_ENCRYPTION)    += crypto/
 obj-$(CONFIG_FS_VERITY)                += verity/
 obj-$(CONFIG_FILE_LOCKING)      += locks.o
-obj-$(CONFIG_COMPAT)           += compat.o
 obj-$(CONFIG_BINFMT_AOUT)      += binfmt_aout.o
 obj-$(CONFIG_BINFMT_EM86)      += binfmt_em86.o
 obj-$(CONFIG_BINFMT_MISC)      += binfmt_misc.o
diff --git a/fs/compat.c b/fs/compat.c
deleted file mode 100644 (file)
index 9b00523..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- *  linux/fs/compat.c
- *
- *  Kernel compatibililty routines for e.g. 32 bit syscall support
- *  on 64 bit kernels.
- *
- *  Copyright (C) 2002       Stephen Rothwell, IBM Corporation
- *  Copyright (C) 1997-2000  Jakub Jelinek  (jakub@redhat.com)
- *  Copyright (C) 1998       Eddie C. Dost  (ecd@skynet.be)
- *  Copyright (C) 2001,2002  Andi Kleen, SuSE Labs 
- *  Copyright (C) 2003       Pavel Machek (pavel@ucw.cz)
- */
-
-#include <linux/compat.h>
-#include <linux/nfs4_mount.h>
-#include <linux/syscalls.h>
-#include <linux/slab.h>
-#include <linux/uaccess.h>
-#include "internal.h"
-
-COMPAT_SYSCALL_DEFINE5(mount, const char __user *, dev_name,
-                      const char __user *, dir_name,
-                      const char __user *, type, compat_ulong_t, flags,
-                      const void __user *, data)
-{
-       char *kernel_type;
-       void *options;
-       char *kernel_dev;
-       int retval;
-
-       kernel_type = copy_mount_string(type);
-       retval = PTR_ERR(kernel_type);
-       if (IS_ERR(kernel_type))
-               goto out;
-
-       kernel_dev = copy_mount_string(dev_name);
-       retval = PTR_ERR(kernel_dev);
-       if (IS_ERR(kernel_dev))
-               goto out1;
-
-       options = copy_mount_options(data);
-       retval = PTR_ERR(options);
-       if (IS_ERR(options))
-               goto out2;
-
-       retval = do_mount(kernel_dev, dir_name, kernel_type, flags, options);
-
- out3:
-       kfree(options);
- out2:
-       kfree(kernel_dev);
- out1:
-       kfree(kernel_type);
- out:
-       return retval;
-}
index 10517ece45167f7f3281dfedbe8065022816b245..a7cd0f64faa4ab27ee3bcc0325a9e4e641d7c7ef 100644 (file)
@@ -82,9 +82,6 @@ int may_linkat(struct path *link);
 /*
  * namespace.c
  */
-extern void *copy_mount_options(const void __user *);
-extern char *copy_mount_string(const void __user *);
-
 extern struct vfsmount *lookup_mnt(const struct path *);
 extern int finish_automount(struct vfsmount *, struct path *);
 
index bae0e95b3713a3bf143754a523f603a5a330b8ab..12b431b61462b957f21506a9d0b333c50886279f 100644 (file)
@@ -3072,7 +3072,7 @@ static void shrink_submounts(struct mount *mnt)
        }
 }
 
-void *copy_mount_options(const void __user * data)
+static void *copy_mount_options(const void __user * data)
 {
        char *copy;
        unsigned size;
@@ -3097,7 +3097,7 @@ void *copy_mount_options(const void __user * data)
        return copy;
 }
 
-char *copy_mount_string(const void __user *data)
+static char *copy_mount_string(const void __user *data)
 {
        return data ? strndup_user(data, PATH_MAX) : NULL;
 }
index d38c4d7e83bd32391dc99df671f88a1bc068cc30..100632280cccebe2ce6c222cb1042b9cd4def414 100644 (file)
@@ -522,12 +522,6 @@ asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
 asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
                                 compat_ulong_t arg);
 
-/* fs/namespace.c */
-asmlinkage long compat_sys_mount(const char __user *dev_name,
-                                const char __user *dir_name,
-                                const char __user *type, compat_ulong_t flags,
-                                const void __user *data);
-
 /* fs/open.c */
 asmlinkage long compat_sys_statfs(const char __user *pathname,
                                  struct compat_statfs __user *buf);
index 995b36c2ea7d8a4edbff1e79e5551c4b941359eb..fc98c9437609769af6b28d86af94e29cf5d0090e 100644 (file)
@@ -140,7 +140,7 @@ __SYSCALL(__NR_renameat, sys_renameat)
 #define __NR_umount2 39
 __SYSCALL(__NR_umount2, sys_umount)
 #define __NR_mount 40
-__SC_COMP(__NR_mount, sys_mount, compat_sys_mount)
+__SYSCALL(__NR_mount, sys_mount)
 #define __NR_pivot_root 41
 __SYSCALL(__NR_pivot_root, sys_pivot_root)
 
index 995b36c2ea7d8a4edbff1e79e5551c4b941359eb..fc98c9437609769af6b28d86af94e29cf5d0090e 100644 (file)
@@ -140,7 +140,7 @@ __SYSCALL(__NR_renameat, sys_renameat)
 #define __NR_umount2 39
 __SYSCALL(__NR_umount2, sys_umount)
 #define __NR_mount 40
-__SC_COMP(__NR_mount, sys_mount, compat_sys_mount)
+__SYSCALL(__NR_mount, sys_mount)
 #define __NR_pivot_root 41
 __SYSCALL(__NR_pivot_root, sys_pivot_root)
 
index 3ca6fe057a0b1f52eba54f83a488d1159851ff2a..c2866c65965061c50f4244c1db64447150c6c9be 100644 (file)
@@ -32,7 +32,7 @@
 18     spu     oldstat                         sys_ni_syscall
 19     common  lseek                           sys_lseek                       compat_sys_lseek
 20     common  getpid                          sys_getpid
-21     nospu   mount                           sys_mount                       compat_sys_mount
+21     nospu   mount                           sys_mount
 22     32      umount                          sys_oldumount
 22     64      umount                          sys_ni_syscall
 22     spu     umount                          sys_ni_syscall
index 6a0bbea225db0d76da7dfe89143face0eb520276..8e0806f6c38eb0b051a6ca46380e735846486600 100644 (file)
@@ -26,7 +26,7 @@
 16   32                lchown                  -                               compat_sys_s390_lchown16
 19   common    lseek                   sys_lseek                       compat_sys_lseek
 20   common    getpid                  sys_getpid                      sys_getpid
-21   common    mount                   sys_mount                       compat_sys_mount
+21   common    mount                   sys_mount
 22   common    umount                  sys_oldumount                   compat_sys_oldumount
 23   32                setuid                  -                               compat_sys_s390_setuid16
 24   32                getuid                  -                               compat_sys_s390_getuid16