On Thu, Apr 05, 2018 at 12:20:15PM +0900, KAWAMATA Yoshihiro wrote:
> I built a 6.3 kernel with tmpfs enabled.
> 
> Here's a diff of this kernel with GENERIC:
> 
> # diff -u GENERIC GENERIC_TMPFS
> --- GENERIC     Thu Mar 15 03:52:16 2018
> +++ GENERIC_TMPFS       Thu Apr  5 00:56:50 2018
> @@ -11,6 +11,7 @@
>  
>  machine                amd64
>  include                "../../../conf/GENERIC"
> +option         TMPFS           # efficient memory file system
>  maxusers       80                      # estimated number of users
>  
>  option         USER_PCICONF    # user-space PCI configuration
> 
> And I tried to mount tmpfs on this kernel, but it didn't:
> 
> # mount_tmpfs tmpfs /root/mnt_test
> mount_tmpfs: tmpfs on /root/mnt_test: Bad address


I have seen that issue as well.  I think it's because we are now
being passed the data and we don't have to do the copyin ourselves.
When the conversion happened, someone forgot to remove the copyin.

Does this help?

diff --git a/sys/tmpfs/tmpfs_vfsops.c b/sys/tmpfs/tmpfs_vfsops.c
index 7fe10c5f00e..b4d671d1160 100644
--- a/sys/tmpfs/tmpfs_vfsops.c
+++ b/sys/tmpfs/tmpfs_vfsops.c
@@ -121,9 +121,6 @@ tmpfs_mount(struct mount *mp, const char *path, void *data,
        if (tmpfs_mem_info(1) < TMPFS_PAGES_RESERVED)
                return EINVAL;
 
-       error = copyin(data, args, sizeof(struct tmpfs_args));
-       if (error)
-               return error;
        if (args->ta_root_uid == VNOVAL || args->ta_root_gid == VNOVAL ||
            args->ta_root_mode == VNOVAL)
                return EINVAL;

Reply via email to