diff options
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 4cafe6a19167..02ebd1585eaf 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -4569,6 +4569,18 @@ static int selinux_socket_post_create(struct socket *sock, int family, | |||
4569 | return err; | 4569 | return err; |
4570 | } | 4570 | } |
4571 | 4571 | ||
4572 | static int selinux_socket_socketpair(struct socket *socka, | ||
4573 | struct socket *sockb) | ||
4574 | { | ||
4575 | struct sk_security_struct *sksec_a = socka->sk->sk_security; | ||
4576 | struct sk_security_struct *sksec_b = sockb->sk->sk_security; | ||
4577 | |||
4578 | sksec_a->peer_sid = sksec_b->sid; | ||
4579 | sksec_b->peer_sid = sksec_a->sid; | ||
4580 | |||
4581 | return 0; | ||
4582 | } | ||
4583 | |||
4572 | /* Range of port numbers used to automatically bind. | 4584 | /* Range of port numbers used to automatically bind. |
4573 | Need to determine whether we should perform a name_bind | 4585 | Need to determine whether we should perform a name_bind |
4574 | permission check between the socket and the port number. */ | 4586 | permission check between the socket and the port number. */ |
@@ -6999,6 +7011,7 @@ static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { | |||
6999 | 7011 | ||
7000 | LSM_HOOK_INIT(socket_create, selinux_socket_create), | 7012 | LSM_HOOK_INIT(socket_create, selinux_socket_create), |
7001 | LSM_HOOK_INIT(socket_post_create, selinux_socket_post_create), | 7013 | LSM_HOOK_INIT(socket_post_create, selinux_socket_post_create), |
7014 | LSM_HOOK_INIT(socket_socketpair, selinux_socket_socketpair), | ||
7002 | LSM_HOOK_INIT(socket_bind, selinux_socket_bind), | 7015 | LSM_HOOK_INIT(socket_bind, selinux_socket_bind), |
7003 | LSM_HOOK_INIT(socket_connect, selinux_socket_connect), | 7016 | LSM_HOOK_INIT(socket_connect, selinux_socket_connect), |
7004 | LSM_HOOK_INIT(socket_listen, selinux_socket_listen), | 7017 | LSM_HOOK_INIT(socket_listen, selinux_socket_listen), |