]> git.karo-electronics.de Git - linux-beck.git/commitdiff
userns: Convert loop to use kuid_t instead of uid_t
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 11 Feb 2012 19:23:51 +0000 (11:23 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 21 Sep 2012 10:13:20 +0000 (03:13 -0700)
Cc: Jens Axboe <jaxboe@fusionio.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
drivers/block/loop.c
include/linux/loop.h
init/Kconfig

index 3bba65510d23afdf39070f7d23552e8e15e27af2..e9d594fd12cbee408251c4ead03d1b71183ff7ae 100644 (file)
@@ -1038,10 +1038,10 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
 {
        int err;
        struct loop_func_table *xfer;
-       uid_t uid = current_uid();
+       kuid_t uid = current_uid();
 
        if (lo->lo_encrypt_key_size &&
-           lo->lo_key_owner != uid &&
+           !uid_eq(lo->lo_key_owner, uid) &&
            !capable(CAP_SYS_ADMIN))
                return -EPERM;
        if (lo->lo_state != Lo_bound)
index 11a41a8f08eb9e98cb1105982d093c3d075d5206..9635116dd830e3634a6c6e2d06219eb36661578c 100644 (file)
@@ -44,7 +44,7 @@ struct loop_device {
        int             lo_encrypt_key_size;
        struct loop_func_table *lo_encryption;
        __u32           lo_init[2];
-       uid_t           lo_key_owner;   /* Who set the key */
+       kuid_t          lo_key_owner;   /* Who set the key */
        int             (*ioctl)(struct loop_device *, int cmd, 
                                 unsigned long arg); 
 
index f0371a65ac06c912c60716c3c0f91de69bcb2165..f31599739f7f06647a631d76b8bd346bca4103b2 100644 (file)
@@ -960,7 +960,6 @@ config UIDGID_CONVERTED
        depends on !UML || HOSTFS = n
 
        # The rare drivers that won't build
-       depends on BLK_DEV_LOOP = n
        depends on ANDROID_BINDER_IPC = n
 
        # Security modules