Commit e4849737 authored by Eric W. Biederman's avatar Eric W. Biederman

userns: Convert loop to use kuid_t instead of uid_t

Cc: Jens Axboe <jaxboe@fusionio.com>
Acked-by: default avatarSerge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
parent d03ca582
...@@ -1038,10 +1038,10 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info) ...@@ -1038,10 +1038,10 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
{ {
int err; int err;
struct loop_func_table *xfer; struct loop_func_table *xfer;
uid_t uid = current_uid(); kuid_t uid = current_uid();
if (lo->lo_encrypt_key_size && if (lo->lo_encrypt_key_size &&
lo->lo_key_owner != uid && !uid_eq(lo->lo_key_owner, uid) &&
!capable(CAP_SYS_ADMIN)) !capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (lo->lo_state != Lo_bound) if (lo->lo_state != Lo_bound)
......
...@@ -44,7 +44,7 @@ struct loop_device { ...@@ -44,7 +44,7 @@ struct loop_device {
int lo_encrypt_key_size; int lo_encrypt_key_size;
struct loop_func_table *lo_encryption; struct loop_func_table *lo_encryption;
__u32 lo_init[2]; __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, int (*ioctl)(struct loop_device *, int cmd,
unsigned long arg); unsigned long arg);
......
...@@ -960,7 +960,6 @@ config UIDGID_CONVERTED ...@@ -960,7 +960,6 @@ config UIDGID_CONVERTED
depends on !UML || HOSTFS = n depends on !UML || HOSTFS = n
# The rare drivers that won't build # The rare drivers that won't build
depends on BLK_DEV_LOOP = n
depends on ANDROID_BINDER_IPC = n depends on ANDROID_BINDER_IPC = n
# Security modules # Security modules
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment