Thread (8 messages) 8 messages, 4 authors, 2023-05-18

Re: [PATCH v2 2/2] selinux: Implement mptcp_add_subflow hook

From: Paul Moore <paul@paul-moore.com>
Date: 2023-05-18 17:12:15
Also in: linux-security-module, lkml, mptcp, selinux

On Apr 20, 2023 Matthieu Baerts [off-list ref] wrote:
Newly added subflows should inherit the LSM label from the associated
MPTCP socket regardless of the current context.

This patch implements the above copying sid and class from the MPTCP
socket context, deleting the existing subflow label, if any, and then
re-creating the correct one.

The new helper reuses the selinux_netlbl_sk_security_free() function,
and the latter can end-up being called multiple times with the same
argument; we additionally need to make it idempotent.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Matthieu Baerts <redacted>
Signed-off-by: Matthieu Baerts <redacted>
---
v2:
 - Address Paul's comments:
   - use "MPTCP socket" instead of "msk" in the commit message
   - "updated" context instead of "current" one in the comment
---
 security/selinux/hooks.c    | 16 ++++++++++++++++
 security/selinux/netlabel.c |  8 ++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)
Also merged into selinux/next, thanks again.

--
paul-moore.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help