Skip to content
Commit 88b7d370 authored by Alexey Kodanev's avatar Alexey Kodanev Committed by Paul Moore
Browse files

selinux: fix address family in bind() and connect() to match address/port



Since sctp_bindx() and sctp_connectx() can have multiple addresses,
sk_family can differ from sa_family. Therefore, selinux_socket_bind()
and selinux_socket_connect_helper(), which process sockaddr structure
(address and port), should use the address family from that structure
too, and not from the socket one.

The initialization of the data for the audit record is moved above,
in selinux_socket_bind(), so that there is no duplicate changes and
code.

Fixes: d452930f ("selinux: Add SCTP support")
Suggested-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarAlexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 0f8db8cc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment