MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-next] Squash to "security, lsm: Introduce security_mptcp_add_subflow()"
@ 2023-04-19 10:17 Matthieu Baerts
  2023-04-19 11:40 ` Squash to "security, lsm: Introduce security_mptcp_add_subflow()": Tests Results MPTCP CI
  2023-04-19 13:14 ` [PATCH mptcp-next] Squash to "security, lsm: Introduce security_mptcp_add_subflow()" Matthieu Baerts
  0 siblings, 2 replies; 3+ messages in thread
From: Matthieu Baerts @ 2023-04-19 10:17 UTC (permalink / raw)
  To: mptcp; +Cc: Paolo Abeni, Matthieu Baerts

lsm: move the MPTCP hook comments to security/security.c

This is similar to what has been done in lsm/next, e.g. with
commit 4a49f592e931 ("lsm: move the SCTP hook comments to security/security.c"),
see the link below.

By doing that, the patch can be applied without conflicts in lsm/next
branch.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm.git/commit/?h=next&id=4a49f592e931
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---

Notes:
    to be squashed in "security, lsm: Introduce security_mptcp_add_subflow()"

 include/linux/lsm_hooks.h |  9 ---------
 security/security.c       | 10 ++++++++++
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
index 333b21095638..6e156d2acffc 100644
--- a/include/linux/lsm_hooks.h
+++ b/include/linux/lsm_hooks.h
@@ -1096,15 +1096,6 @@
  *	@skb pointer to skbuff of association packet.
  *	Return 0 if permission is granted.
  *
- * Security hooks for MPTCP
- *
- * @mptcp_add_subflow
- *	Update the labeling for the given MPTCP subflow, to match to
- *	owning MPTCP socket.
- *	@sk: the owning MPTCP socket
- *	@ssk: the new subflow
- *	Return 0 if successful, otherwise < 0 error code.
- *
  * Security hooks for Infiniband
  *
  * @ib_pkey_access:
diff --git a/security/security.c b/security/security.c
index 4e56893aada5..1e99200ed0c9 100644
--- a/security/security.c
+++ b/security/security.c
@@ -2494,6 +2494,16 @@ int security_sctp_assoc_established(struct sctp_association *asoc,
 }
 EXPORT_SYMBOL(security_sctp_assoc_established);
 
+/**
+ * security_mptcp_add_subflow() - Inherit the LSM label from the MPTCP socket
+ * @sk: the owning MPTCP socket
+ * @ssk: the new subflow
+ *
+ * Update the labeling for the given MPTCP subflow, to match the one of the
+ * owning MPTCP socket.
+ *
+ * Return: Returns 0 on success or a negative error code on failure.
+ */
 int security_mptcp_add_subflow(struct sock *sk, struct sock *ssk)
 {
 	return call_int_hook(mptcp_add_subflow, 0, sk, ssk);

base-commit: 0eb4d1a28182c9af28ba970a8a899a2be5407867
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-19 13:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-19 10:17 [PATCH mptcp-next] Squash to "security, lsm: Introduce security_mptcp_add_subflow()" Matthieu Baerts
2023-04-19 11:40 ` Squash to "security, lsm: Introduce security_mptcp_add_subflow()": Tests Results MPTCP CI
2023-04-19 13:14 ` [PATCH mptcp-next] Squash to "security, lsm: Introduce security_mptcp_add_subflow()" Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox