Skip to content

security: fixups for the security hooks in sctp

Xin Long linux-sctp linux-security-module netdev selinux 2 versions – Applied

Status from this message: This series was applied to netdev/net.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 14 repliesApplied 4/4
  2. v14 patches 14 repliesSuperseded

Changes in v2 from the cover letter

- See each patch, and thanks the help from Ondrej, Paul and Richard.

Patches in v2 All 4 applied

#Subject and filesSizeRepliesApplied
1/4security: pass asoc to sctp_assoc_request and sctp_sk_cloneDocumentation/security/SCTP.rst include/linux/lsm_hook_defs.h include/linux/lsm_hooks.h +8 more+76 -770 repliesApplied
2/4security: call security_sctp_assoc_request in sctp_sf_do_5_1D_ceDocumentation/security/SCTP.rst net/sctp/sm_statefuns.c+14 -60 repliesApplied
3/4security: add sctp_assoc_established hookDocumentation/security/SCTP.rst include/linux/lsm_hook_defs.h include/linux/lsm_hooks.h +3 more+32 -130 repliesApplied
4/4security: implement sctp_assoc_established hook in selinuxsecurity/selinux/hooks.c+13 -114 repliesApplied

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchRichard Haines
1/4R-b T-b
2/4R-b T-b
3/4R-b T-b
4/4R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCHv2 net 0/4] security: fixups for the security hooks in sctp

There are a couple of problems in the currect security hooks in sctp:

1. The hooks incorrectly treat sctp_endpoint in SCTP as request_sock in TCP, while it's in fact no more than an extension of the sock, and represents the local host. It is created when sock is created, not when a conn request comes. sctp_association is actually the correct one to represent the connection, and created when a conn request arrives.

2. security_sctp_assoc_request() hook should also be called in processing COOKIE ECHO, as that's the place where the real assoc is created and used in the future.

The problems above may cause accept sk, peeloff sk or client sk having the incorrect security labels.

So this patchset is to change some hooks and pass asoc into them and save these secids into asoc, as well as add the missing sctp_assoc_request hook into the COOKIE ECHO processing.

v1->v2:
- See each patch, and thanks the help from Ondrej, Paul and Richard.

Xin Long (4):
security: pass asoc to sctp_assoc_request and sctp_sk_clone
security: call security_sctp_assoc_request in sctp_sf_do_5_1D_ce
security: add sctp_assoc_established hook
security: implement sctp_assoc_established hook in selinux

 Documentation/security/SCTP.rst     | 65 +++++++++++++++--------------
 include/linux/lsm_hook_defs.h       |  6 ++-
 include/linux/lsm_hooks.h           | 13 ++++--
 include/linux/security.h            | 17 +++++---
 include/net/sctp/structs.h          | 20 ++++-----
 net/sctp/sm_statefuns.c             | 31 ++++++++------
 net/sctp/socket.c                   |  5 +--
 security/security.c                 | 15 +++++--
 security/selinux/hooks.c            | 34 ++++++++++-----
 security/selinux/include/netlabel.h |  4 +-
 security/selinux/netlabel.c         | 18 ++++----
 11 files changed, 133 insertions(+), 95 deletions(-)
Signature · 1 line
2.27.0