Skip to content

Commit 02f0691

Browse files
committed
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 <paul@paul-moore.com>
1 parent 0e0e367 commit 02f0691

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/iucv/af_iucv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/skbuff.h>
2323
#include <linux/init.h>
2424
#include <linux/poll.h>
25+
#include <linux/security.h>
2526
#include <net/sock.h>
2627
#include <asm/ebcdic.h>
2728
#include <asm/cpcmd.h>
@@ -530,8 +531,10 @@ static void iucv_sock_close(struct sock *sk)
530531

531532
static void iucv_sock_init(struct sock *sk, struct sock *parent)
532533
{
533-
if (parent)
534+
if (parent) {
534535
sk->sk_type = parent->sk_type;
536+
security_sk_clone(parent, sk);
537+
}
535538
}
536539

537540
static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio, int kern)

0 commit comments

Comments
 (0)