aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-05-25 18:37:54 -0400
committerEric W. Biederman <ebiederm@xmission.com>2012-09-13 21:28:04 -0400
commitc6089735e7243a10faad676680c6e18d50959f74 (patch)
treeb2a19e10a0a126298aaa7a145e1ee327e3e2d85e /net/rxrpc
parent9a56c2db49e7349c7963f0ce66c1ef578d44ebd3 (diff)
userns: net: Call key_alloc with GLOBAL_ROOT_UID, GLOBAL_ROOT_GID instead of 0, 0
In net/dns_resolver/dns_key.c and net/rxrpc/ar-key.c make them work with user namespaces enabled where key_alloc takes kuids and kgids. Pass GLOBAL_ROOT_UID and GLOBAL_ROOT_GID instead of bare 0's. Cc: Sage Weil <sage@inktank.com> Cc: ceph-devel@vger.kernel.org Cc: David Howells <dhowells@redhat.com> Cc: David Miller <davem@davemloft.net> Cc: linux-afs@lists.infradead.org Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'net/rxrpc')
-rw-r--r--net/rxrpc/ar-key.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c
index 8b1f9f49960f..011d2384b115 100644
--- a/net/rxrpc/ar-key.c
+++ b/net/rxrpc/ar-key.c
@@ -948,7 +948,8 @@ int rxrpc_get_server_data_key(struct rxrpc_connection *conn,
948 948
949 _enter(""); 949 _enter("");
950 950
951 key = key_alloc(&key_type_rxrpc, "x", 0, 0, cred, 0, 951 key = key_alloc(&key_type_rxrpc, "x",
952 GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, cred, 0,
952 KEY_ALLOC_NOT_IN_QUOTA); 953 KEY_ALLOC_NOT_IN_QUOTA);
953 if (IS_ERR(key)) { 954 if (IS_ERR(key)) {
954 _leave(" = -ENOMEM [alloc %ld]", PTR_ERR(key)); 955 _leave(" = -ENOMEM [alloc %ld]", PTR_ERR(key));
@@ -994,7 +995,8 @@ struct key *rxrpc_get_null_key(const char *keyname)
994 struct key *key; 995 struct key *key;
995 int ret; 996 int ret;
996 997
997 key = key_alloc(&key_type_rxrpc, keyname, 0, 0, cred, 998 key = key_alloc(&key_type_rxrpc, keyname,
999 GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, cred,
998 KEY_POS_SEARCH, KEY_ALLOC_NOT_IN_QUOTA); 1000 KEY_POS_SEARCH, KEY_ALLOC_NOT_IN_QUOTA);
999 if (IS_ERR(key)) 1001 if (IS_ERR(key))
1000 return key; 1002 return key;