Thread (32 messages) 32 messages, 3 authors, 2021-03-12
STALE1946d REVIEWED: 3 (1M)
Revisions (31)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 [diff vs current]
  4. v1 [diff vs current]
  5. v1 [diff vs current]
  6. v2 [diff vs current]
  7. v5 [diff vs current]
  8. v7 [diff vs current]
  9. v8 [diff vs current]
  10. v10 [diff vs current]
  11. v11 [diff vs current]
  12. v11 [diff vs current]
  13. v12 [diff vs current]
  14. v12 [diff vs current]
  15. v13 [diff vs current]
  16. v24 [diff vs current]
  17. v25 current
  18. v26 [diff vs current]
  19. v27 [diff vs current]
  20. v28 [diff vs current]
  21. v29 [diff vs current]
  22. v30 [diff vs current]
  23. v31 [diff vs current]
  24. v32 [diff vs current]
  25. v33 [diff vs current]
  26. v34 [diff vs current]
  27. v34 [diff vs current]
  28. v35 [diff vs current]
  29. v36 [diff vs current]
  30. v37 [diff vs current]
  31. v38 [diff vs current]

[PATCH v25 25/25] AppArmor: Remove the exclusive flag

From: Casey Schaufler <casey@schaufler-ca.com>
Date: 2021-03-09 15:11:24
Also in: lkml, selinux
Subsystem: apparmor security module, security subsystem, the rest · Maintainers: John Johansen, Georgia Garcia, Paul Moore, James Morris, "Serge E. Hallyn", Linus Torvalds

With the inclusion of the interface LSM process attribute
mechanism AppArmor no longer needs to be treated as an
"exclusive" security module. Remove the flag that indicates
it is exclusive. Remove the stub getpeersec_dgram AppArmor
hook as it has no effect in the single LSM case and
interferes in the multiple LSM case.

Acked-by: Stephen Smalley <redacted>
Acked-by: John Johansen <john.johansen@canonical.com>
Reviewed-by: Kees Cook <redacted>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
---
 security/apparmor/lsm.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 16ccc4a002d0..c6dc0b6f6712 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -1138,22 +1138,6 @@ static int apparmor_socket_getpeersec_stream(struct socket *sock,
 	return error;
 }
 
-/**
- * apparmor_socket_getpeersec_dgram - get security label of packet
- * @sock: the peer socket
- * @skb: packet data
- * @secid: pointer to where to put the secid of the packet
- *
- * Sets the netlabel socket state on sk from parent
- */
-static int apparmor_socket_getpeersec_dgram(struct socket *sock,
-					    struct sk_buff *skb, u32 *secid)
-
-{
-	/* TODO: requires secid support */
-	return -ENOPROTOOPT;
-}
-
 /**
  * apparmor_sock_graft - Initialize newly created socket
  * @sk: child sock
@@ -1257,8 +1241,6 @@ static struct security_hook_list apparmor_hooks[] __lsm_ro_after_init = {
 #endif
 	LSM_HOOK_INIT(socket_getpeersec_stream,
 		      apparmor_socket_getpeersec_stream),
-	LSM_HOOK_INIT(socket_getpeersec_dgram,
-		      apparmor_socket_getpeersec_dgram),
 	LSM_HOOK_INIT(sock_graft, apparmor_sock_graft),
 #ifdef CONFIG_NETWORK_SECMARK
 	LSM_HOOK_INIT(inet_conn_request, apparmor_inet_conn_request),
@@ -1927,7 +1909,7 @@ static int __init apparmor_init(void)
 
 DEFINE_LSM(apparmor) = {
 	.name = "apparmor",
-	.flags = LSM_FLAG_LEGACY_MAJOR | LSM_FLAG_EXCLUSIVE,
+	.flags = LSM_FLAG_LEGACY_MAJOR,
 	.enabled = &apparmor_enabled,
 	.blobs = &apparmor_blob_sizes,
 	.init = apparmor_init,
-- 
2.29.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help