From: Paul Moore Date: Tue, 7 Jun 2016 14:30:53 +0000 (-0400) Subject: iucv: properly clone LSM attributes to newly created child sockets X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=02f06918156b32a584ff2dd9ebfa653abf4d8d5d;p=linux-beck.git iucv: properly clone LSM attributes to newly created child sockets Much like we had to do for AF_BLUETOOTH and AF_ALG, make sure we properly clone the parent socket's LSM attributes to newly created child sockets. Signed-off-by: Paul Moore --- diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index fc3598a922b0..a0d1e36a284b 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -530,8 +531,10 @@ static void iucv_sock_close(struct sock *sk) static void iucv_sock_init(struct sock *sk, struct sock *parent) { - if (parent) + if (parent) { sk->sk_type = parent->sk_type; + security_sk_clone(parent, sk); + } } static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio, int kern)