Skip to content

Commit

Permalink
userns: Convert loop to use kuid_t instead of uid_t
Browse files Browse the repository at this point in the history
Cc: Jens Axboe <[email protected]>
Acked-by: Serge Hallyn <[email protected]>
Signed-off-by: Eric W. Biederman <[email protected]>
  • Loading branch information
ebiederm committed Sep 21, 2012
1 parent d03ca58 commit e484973
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e484973

Please sign in to comment.