Skip to content

lsm: introduce and use security_mptcp_add_subflow()

Paolo Abeni linux-security-module mptcp selinux 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 10 repliesIn review
  2. v12 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- fix a few build issues with unusual configurations reported by bots

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2security, lsm: Introduce security_mptcp_add_subflow()include/linux/lsm_hook_defs.h include/linux/lsm_hooks.h include/linux/security.h +2 more+27 -01 reply
2/2selinux: Implement mptcp_add_subflow hooksecurity/selinux/hooks.c security/selinux/netlabel.c+30 -19 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchMat Martineau
1/2A-b
2/2

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

Read the v2 thread

Cover letter [PATCH v2 0/2] lsm: introduce and use security_mptcp_add_subflow()

This series is an attempt to solve the LSM labeling breakage reported here:

https://lore.kernel.org/linux-security-module/CAHC9VhSQnhH3UL4gqzu+YiA1Q3YyLLCv88gLJOvw-0+uw5Lvkw@mail.gmail.com/

As per previous discussion, a new LSM hook is introduced and invoked by the mptcp code to let LSMs set the appropriate label for the newly created subflow.

I'm not sure the chosen hook name is a perfect fit, any suggestion more then welcome.
The new hook requires both the mptcp socket reference and the subflow socket reference, even if the provided LSM implementation for selinux ends-up accessing only the subflow socket. Possibly other LSM implementation could need or use the addtional parameter.

Tested vs the issue reproducer and mptcp self-tests.

v1 -> v2:
- fix a few build issues with unusual configurations reported by bots

Paolo Abeni (2):
security, lsm: Introduce security_mptcp_add_subflow()
selinux: Implement mptcp_add_subflow hook

 include/linux/lsm_hook_defs.h |  1 +
 include/linux/lsm_hooks.h     |  9 +++++++++
 include/linux/security.h      |  6 ++++++
 net/mptcp/subflow.c           |  6 ++++++
 security/security.c           |  5 +++++
 security/selinux/hooks.c      | 27 +++++++++++++++++++++++++++
 security/selinux/netlabel.c   |  4 +++-
 7 files changed, 57 insertions(+), 1 deletion(-)
Signature · 1 line
2.38.1