]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rxrpc: The server keyring isn't network-namespaced
authorDavid Howells <dhowells@redhat.com>
Wed, 30 Sep 2020 18:52:08 +0000 (19:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Oct 2020 09:55:58 +0000 (11:55 +0200)
[ Upstream commit fea99111244bae44e7d82a973744d27ea1567814 ]

The keyring containing the server's tokens isn't network-namespaced, so it
shouldn't be looked up with a network namespace.  It is expected to be
owned specifically by the server, so namespacing is unnecessary.

Fixes: a58946c158a0 ("keys: Pass the network namespace into request_key mechanism")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/rxrpc/key.c

index 32f46edcf7c67b5db34551b2758bc648142b45cb..64cbbd2f16944e831a1fc6eaf0b386aff38f232b 100644 (file)
@@ -941,7 +941,7 @@ int rxrpc_server_keyring(struct rxrpc_sock *rx, char __user *optval,
        if (IS_ERR(description))
                return PTR_ERR(description);
 
-       key = request_key_net(&key_type_keyring, description, sock_net(&rx->sk), NULL);
+       key = request_key(&key_type_keyring, description, NULL);
        if (IS_ERR(key)) {
                kfree(description);
                _leave(" = %ld", PTR_ERR(key));