summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2017-07-10 17:00:48 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2017-07-12 13:38:06 +0300
commit2acce6aa9f6569d4e135b2c4cfb56acce95efaeb (patch)
tree3975af5b52a0f680eee115ee70d59adc51eaef57
parent7459e1d25ffefa2b1be799477fcc1f6c62f6cec7 (diff)
downloadlinux-2acce6aa9f6569d4e135b2c4cfb56acce95efaeb.tar.xz
Networking
crypto: af_alg - Avoid sock_graft call warning The newly added sock_graft warning triggers in af_alg_accept. It's harmless as we're essentially doing sock->sk = sock->sk. The sock_graft call is actually redundant because all the work it does is subsumed by sock_init_data. However, it was added to placate SELinux as it uses it to initialise its internal state. This patch avoisd the warning by making the SELinux call directly. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: David S. Miller <davem@davemloft.net>
-rw-r--r--crypto/af_alg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 3556d8eb54a7..92a3d540d920 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -287,7 +287,7 @@ int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern)
goto unlock;
sock_init_data(newsock, sk2);
- sock_graft(sk2, newsock);
+ security_sock_graft(sk2, newsock);
security_sk_clone(sk, sk2);
err = type->accept(ask->private, sk2);