Skip to content

Commit

Permalink
UBUNTU: SAUCE: Stacking v38: AppArmor: Remove the exclusive flag
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/2012136

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 <stephen.smalley.work@gmail.com>
Acked-by: John Johansen <john.johansen@canonical.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
  • Loading branch information
Casey Schaufler authored and Andrea Righi committed Mar 23, 2023
1 parent d12925d commit 8dcb03f
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions security/apparmor/lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1490,22 +1490,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
Expand Down Expand Up @@ -1630,8 +1614,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),
Expand Down Expand Up @@ -2318,7 +2300,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,
Expand Down

0 comments on commit 8dcb03f

Please sign in to comment.