aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 9bc12bcddc2c..e6b1b7410321 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1401,7 +1401,9 @@ static inline u16 socket_type_to_security_class(int family, int type, int protoc
1401 return SECCLASS_KCM_SOCKET; 1401 return SECCLASS_KCM_SOCKET;
1402 case PF_QIPCRTR: 1402 case PF_QIPCRTR:
1403 return SECCLASS_QIPCRTR_SOCKET; 1403 return SECCLASS_QIPCRTR_SOCKET;
1404#if PF_MAX > 43 1404 case PF_SMC:
1405 return SECCLASS_SMC_SOCKET;
1406#if PF_MAX > 44
1405#error New address family defined, please update this function. 1407#error New address family defined, please update this function.
1406#endif 1408#endif
1407 } 1409 }
@@ -4363,7 +4365,8 @@ static int selinux_socket_bind(struct socket *sock, struct sockaddr *address, in
4363 4365
4364 inet_get_local_port_range(sock_net(sk), &low, &high); 4366 inet_get_local_port_range(sock_net(sk), &low, &high);
4365 4367
4366 if (snum < max(PROT_SOCK, low) || snum > high) { 4368 if (snum < max(inet_prot_sock(sock_net(sk)), low) ||
4369 snum > high) {
4367 err = sel_netport_sid(sk->sk_protocol, 4370 err = sel_netport_sid(sk->sk_protocol,
4368 snum, &sid); 4371 snum, &sid);
4369 if (err) 4372 if (err)