summaryrefslogtreecommitdiff
path: root/fs/afs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-05-28 08:12:35 +0300
committerDavid S. Miller <davem@davemloft.net>2020-05-28 21:11:46 +0300
commit298cd88a66a02c899772ffafbf648786ceb5ab95 (patch)
treeff5a1b2e6e6c89240cd6846873e1fa54fe3de943 /fs/afs
parent7d7207c2d57080af93fc323dc6a85bd79207b4c6 (diff)
downloadlinux-298cd88a66a02c899772ffafbf648786ceb5ab95.tar.xz
rxrpc: add rxrpc_sock_set_min_security_level
Add a helper to directly set the RXRPC_MIN_SECURITY_LEVEL sockopt from kernel space without going through a fake uaccess. Thanks to David Howells for the documentation updates. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/rxrpc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 1ecc67da6c1a..e313dae01674 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -37,7 +37,6 @@ int afs_open_socket(struct afs_net *net)
{
struct sockaddr_rxrpc srx;
struct socket *socket;
- unsigned int min_level;
int ret;
_enter("");
@@ -57,9 +56,8 @@ int afs_open_socket(struct afs_net *net)
srx.transport.sin6.sin6_family = AF_INET6;
srx.transport.sin6.sin6_port = htons(AFS_CM_PORT);
- min_level = RXRPC_SECURITY_ENCRYPT;
- ret = kernel_setsockopt(socket, SOL_RXRPC, RXRPC_MIN_SECURITY_LEVEL,
- (void *)&min_level, sizeof(min_level));
+ ret = rxrpc_sock_set_min_security_level(socket->sk,
+ RXRPC_SECURITY_ENCRYPT);
if (ret < 0)
goto error_2;