Skip to content

Commit

Permalink
sctp: label accepted/peeled off sockets
Browse files Browse the repository at this point in the history
Accepted or peeled off sockets were missing a security label (e.g.
SELinux) which means that socket was in "unlabeled" state.

This patch clones the sock's label from the parent sock and resolves the
issue (similar to AF_BLUETOOTH protocol family).

Cc: Paul Moore <[email protected]>
Cc: David Teigland <[email protected]>
Signed-off-by: Marcelo Ricardo Leitner <[email protected]>
Acked-by: Paul Moore <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
marceloleitner authored and davem330 committed Dec 28, 2015
1 parent 9ba0b96 commit 3538a5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -7202,6 +7202,8 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk,

if (newsk->sk_flags & SK_FLAGS_TIMESTAMP)
net_enable_timestamp();

security_sk_clone(sk, newsk);
}

static inline void sctp_copy_descendant(struct sock *sk_to,
Expand Down

0 comments on commit 3538a5c

Please sign in to comment.