Commit 2acce6aa authored by Herbert Xu's avatar Herbert Xu

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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7459e1d2
...@@ -287,7 +287,7 @@ int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern) ...@@ -287,7 +287,7 @@ int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern)
goto unlock; goto unlock;
sock_init_data(newsock, sk2); sock_init_data(newsock, sk2);
sock_graft(sk2, newsock); security_sock_graft(sk2, newsock);
security_sk_clone(sk, sk2); security_sk_clone(sk, sk2);
err = type->accept(ask->private, sk2); err = type->accept(ask->private, sk2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment