]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: correctly handle sa_family cases in selinux_sctp_bind_connect()
authorAlexey Kodanev <alexey.kodanev@oracle.com>
Fri, 11 May 2018 17:15:13 +0000 (20:15 +0300)
committerPaul Moore <paul@paul-moore.com>
Mon, 14 May 2018 19:20:59 +0000 (15:20 -0400)
commit5366848ce8772a932286ae9782597a6b0118e082
treedf0c291add6164031dbce1f413f585b77eb51758
parentebdb2845ebfc96f100818de848c5012818d2570e
selinux: correctly handle sa_family cases in selinux_sctp_bind_connect()

Allow to pass the socket address structure with AF_UNSPEC family for
compatibility purposes. selinux_socket_bind() will further check it
for INADDR_ANY and selinux_socket_connect_helper() should return
EINVAL.

For a bad address family return EINVAL instead of AFNOSUPPORT error,
i.e. what is expected from SCTP protocol in such case.

Fixes: e01a7a1245ab ("selinux: Add SCTP support")
Suggested-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c