Ignore:
Timestamp:
Mar 15, 2017, 2:42:58 AM (6 weeks ago)
Author:
brainslayer
Message:

use new squashfs in all kernels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/fs/super.c

    r31574 r31662  
    471471        int err;
    472472
    473         if (!(flags & MS_KERNMOUNT) &&
     473        if (!(flags & (MS_KERNMOUNT|MS_SUBMOUNT)) &&
    474474            !(type->fs_flags & FS_USERNS_MOUNT) &&
    475475            !capable(CAP_SYS_ADMIN))
     
    501501        if (!s) {
    502502                spin_unlock(&sb_lock);
    503                 s = alloc_super(type, flags, user_ns);
     503                s = alloc_super(type, (flags & ~MS_SUBMOUNT), user_ns);
    504504                if (!s)
    505505                        return ERR_PTR(-ENOMEM);
     
    542542        struct user_namespace *user_ns = current_user_ns();
    543543
     544        /* We don't yet pass the user namespace of the parent
     545         * mount through to here so always use &init_user_ns
     546         * until that changes.
     547         */
     548        if (flags & MS_SUBMOUNT)
     549                user_ns = &init_user_ns;
     550
    544551        /* Ensure the requestor has permissions over the target filesystem */
    545         if (!(flags & MS_KERNMOUNT) && !ns_capable(user_ns, CAP_SYS_ADMIN))
     552        if (!(flags & (MS_KERNMOUNT|MS_SUBMOUNT)) && !ns_capable(user_ns, CAP_SYS_ADMIN))
    546553                return ERR_PTR(-EPERM);
    547554
Note: See TracChangeset for help on using the changeset viewer.