aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-12-24 19:40:09 -0500
committerJames Morris <jmorris@namei.org>2008-12-24 19:40:09 -0500
commitcbacc2c7f066a1e01b33b0e27ae5efbf534bc2db (patch)
tree90d1093131d2a3543a8b3b1f3364e7c6f4081a93 /drivers/block
parent4a6908a3a050aacc9c3a2f36b276b46c0629ad91 (diff)
parent74192246910ff4fb95309ba1a683215644beeb62 (diff)
Merge branch 'next' into for-linus
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/loop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 5c4ee70d5cf3..fb06ed659212 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -936,8 +936,10 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
936{ 936{
937 int err; 937 int err;
938 struct loop_func_table *xfer; 938 struct loop_func_table *xfer;
939 uid_t uid = current_uid();
939 940
940 if (lo->lo_encrypt_key_size && lo->lo_key_owner != current->uid && 941 if (lo->lo_encrypt_key_size &&
942 lo->lo_key_owner != uid &&
941 !capable(CAP_SYS_ADMIN)) 943 !capable(CAP_SYS_ADMIN))
942 return -EPERM; 944 return -EPERM;
943 if (lo->lo_state != Lo_bound) 945 if (lo->lo_state != Lo_bound)
@@ -992,7 +994,7 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
992 if (info->lo_encrypt_key_size) { 994 if (info->lo_encrypt_key_size) {
993 memcpy(lo->lo_encrypt_key, info->lo_encrypt_key, 995 memcpy(lo->lo_encrypt_key, info->lo_encrypt_key,
994 info->lo_encrypt_key_size); 996 info->lo_encrypt_key_size);
995 lo->lo_key_owner = current->uid; 997 lo->lo_key_owner = uid;
996 } 998 }
997 999
998 return 0; 1000 return 0;