Xin Long c081d53f97 security: pass asoc to sctp_assoc_request and sctp_sk_clone
This patch is to move secid and peer_secid from endpoint to association,
and pass asoc to sctp_assoc_request and sctp_sk_clone instead of ep. As
ep is the local endpoint and asoc represents a connection, and in SCTP
one sk/ep could have multiple asoc/connection, saving secid/peer_secid
for new asoc will overwrite the old asoc's.

Note that since asoc can be passed as NULL, security_sctp_assoc_request()
is moved to the place right after the new_asoc is created in
sctp_sf_do_5_1B_init() and sctp_sf_do_unexpected_init().

v1->v2:
  - fix the description of selinux_netlbl_skbuff_setsid(), as Jakub noticed.
  - fix the annotation in selinux_sctp_assoc_request(), as Richard Noticed.

Fixes: 72e89f50084c ("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>
2021-11-03 11:09:20 +00:00
..
2021-07-01 13:19:48 -07:00
2021-06-11 13:32:46 -07:00
2021-11-01 13:36:09 +00:00
2021-10-13 09:40:45 -07:00
2021-08-03 11:50:22 +01:00
2021-10-25 18:02:12 -07:00
2021-10-13 09:40:46 -07:00
2021-10-13 09:40:46 -07:00
2021-07-29 12:18:11 +01:00
2020-05-05 13:23:29 -07:00
2019-12-09 10:36:44 -08:00
2020-06-22 21:12:44 -07:00
2021-10-15 11:33:08 +01:00
2021-07-27 20:11:44 +01:00
2021-10-25 18:02:14 -07:00
2021-03-30 13:29:39 -07:00
2021-10-13 09:40:46 -07:00
2021-07-27 13:05:56 +01:00
2021-10-13 09:40:46 -07:00
2021-10-22 10:20:56 -07:00
2019-12-09 10:36:44 -08:00
2021-10-13 09:40:46 -07:00
2020-03-04 13:25:55 -08:00
2021-10-19 12:24:51 +01:00
2021-05-17 15:29:35 -07:00
2021-10-13 09:40:45 -07:00
2021-08-04 10:01:26 +01:00
2019-04-22 21:47:25 -07:00
2019-10-05 16:29:00 -07:00
2021-11-01 16:33:27 -07:00
2021-08-03 13:05:26 +01:00
2020-06-18 20:46:23 -07:00
2019-12-09 10:28:43 -08:00
2021-09-28 00:18:35 +02:00