Commit e7310c9
security: implement sctp_assoc_established hook in selinux
Different from selinux_inet_conn_established(), it also gives the
secid to asoc->peer_secid in selinux_sctp_assoc_established(),
as one UDP-type socket may have more than one asocs.
Note that peer_secid in asoc will save the peer secid for this
asoc connection, and peer_sid in sksec will just keep the peer
secid for the latest connection. So the right use should be do
peeloff for UDP-type socket if there will be multiple asocs in
one socket, so that the peeloff socket has the right label for
its asoc.
v1->v2:
- call selinux_inet_conn_established() to reduce some code
duplication in selinux_sctp_assoc_established(), as Ondrej
suggested.
- when doing peeloff, it calls sock_create() where it actually
gets secid for socket from socket_sockcreate_sid(). So reuse
SECSID_WILD to ensure the peeloff socket keeps using that
secid after calling selinux_sctp_sk_clone() for client side.
Fixes: 72e89f5 ("security: Add support for SCTP security hooks")
Reported-by: Prashanth Prahlad <pprahlad@redhat.com>
Reviewed-by: Richard Haines <richard_c_haines@btinternet.com>
Tested-by: Richard Haines <richard_c_haines@btinternet.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 7c2ef02 commit e7310c9
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5502 | 5502 | | |
5503 | 5503 | | |
5504 | 5504 | | |
5505 | | - | |
| 5505 | + | |
| 5506 | + | |
5506 | 5507 | | |
5507 | 5508 | | |
5508 | 5509 | | |
| |||
5558 | 5559 | | |
5559 | 5560 | | |
5560 | 5561 | | |
| 5562 | + | |
| 5563 | + | |
| 5564 | + | |
| 5565 | + | |
| 5566 | + | |
| 5567 | + | |
| 5568 | + | |
| 5569 | + | |
| 5570 | + | |
| 5571 | + | |
5561 | 5572 | | |
5562 | 5573 | | |
5563 | 5574 | | |
| |||
7228 | 7239 | | |
7229 | 7240 | | |
7230 | 7241 | | |
| 7242 | + | |
7231 | 7243 | | |
7232 | 7244 | | |
7233 | 7245 | | |
| |||
0 commit comments