Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp618478pxp; Fri, 11 Mar 2022 10:50:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJx03K0hJEKsrgwERfnUUZOEff2aaopq1xi9fF76cIVy/o7pXY8+85/fuz5+WRbAalk9rGLp X-Received: by 2002:a05:6402:26c2:b0:416:4839:3df7 with SMTP id x2-20020a05640226c200b0041648393df7mr10380926edd.210.1647024650188; Fri, 11 Mar 2022 10:50:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647024650; cv=none; d=google.com; s=arc-20160816; b=nbssWPTwl/2gd2Lv0T5e5XEHtGw4isWaBhPpgbm2UsiQWNclSrIuqIBOUCMVB0d6tn uBLIxeNPyKXde1vE3Rk2lR9pfK5RmUdCIG6SB1Vc941pBmGNyrKn2zT+v+gwa2t8TpuO 6xu2wqIz/vvO/Dv6K3Csh8xYbkeKFHuUyc7yRUEB7IGCAb+/FOKZPUoZbBorhnWc2CHQ m+IB7tP8/p8EzSBDi/8fMLaS60AA2wzDgB5h0h+JvYWiXzn/f16bUoeRodhqpL+7Lo+J AWfx267R9U2dapkFWTipXkM84DBD2cJ4ReVfOcyqpWshDN2n+Y+5/bLmULgDzk5a9+xk tCxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ufFIfi+QJcABRY0VK+r+pIW1TjiSDfvy9tEFxMIQ5C8=; b=TbFpsH89qgvDv7nBYHtUDxb9/nrUu8607SIR+wx13zrf1G7E4eT7bIBPLkjs78LdX/ GnJPkqXZj+G74pMAWGP2D/Q+mG4m7PzTlTBOgTWgeg78IWQkLDlI/leSuZoZjA08kgyL O6VzzdJ2cL3VF5N0BUrzzW1FixErn4i8ZMD6HrH7zCHVtjhYAxj4O0uYn13plzGj0tXZ c9w7B4XpYkqgv0mBs0WiWA3hEFeGBB6jUf7Lknpo7MxSldatXLq0i6vFuyBu4OhOVv9b 72tZsKyUekwnKPskvgU6yW2OCI1Rm3mL2zIKwOVPlJLg0AvBhvWlq9/7H187up5ZH5Z5 HY6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=mobOI7BF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb11-20020a170907784b00b006d176b0a237si5614144ejc.805.2022.03.11.10.50.24; Fri, 11 Mar 2022 10:50:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=mobOI7BF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345139AbiCKACW (ORCPT + 99 others); Thu, 10 Mar 2022 19:02:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345102AbiCKACP (ORCPT ); Thu, 10 Mar 2022 19:02:15 -0500 Received: from sonic308-16.consmr.mail.ne1.yahoo.com (sonic308-16.consmr.mail.ne1.yahoo.com [66.163.187.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A23471A06CB for ; Thu, 10 Mar 2022 16:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1646956873; bh=ufFIfi+QJcABRY0VK+r+pIW1TjiSDfvy9tEFxMIQ5C8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=mobOI7BFWqlqOI7w/QW+5ttyB+ulpgTo4PDQaRD/jBdp+2Wfh1YOZxvXxNyaLR98fbfjDahOeS9YqUgr8/9vIxopbx9NAnU9RfzBr2DKSnc/DjlI38XWXjgBgruSCApK+RS87qbXVqlpfg+4/+78VoUkj7KcD89tGQ/GYzxN4eTSkFtv7Vo+RVWWLL83ekJ85YlDpBrYsfh3SVOebFlvoGQGGi88p/nu6aZZbEHM4XJsj+6aR3KLU+WR1fNR52B/AkJPnuX+UyXYboYaov3gnGTifxndR9MhUY4KA4klQWvy5YIuGIhwPbSwseabOu0vu8XId6cyn9glmoDiien5Tg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1646956873; bh=aOP+pLUA6Rg1M2NxD6rHfWgXBkXW4mkGNdVoDRvsjiM=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=shMzy+BtmeE6A3DzgYmaXqfLTz6WoN5sgnkOeXNrkQLk4tseVhM7PhFf1JYxC4AZY8WT2T0dQ7Jif6Wt6J+ZGLDAGC9HYc5KKFxp3iu1S+YvvEWzlI73pglKojfSFKfS7nCuF/B4xmhx9/zAIJMwxakCNPCr/jh2keuY6gtgyc7oad7rIN+ylDhtCrxP81iK0s2wrgq6LCo04210Zw587cNSb9F4Bly4LxMH5HvQxxhgWhsQeHaelu3PvMZHVCkGKpefjtdBagRUJ0c5ehL7fdgsAso3C12vLpZ3a7OUdckLzKazuxmF7bt7tNu9EvXNf70aCmyTEO4ugVBADA6S+A== X-YMail-OSG: 8tsblVoVM1nI3rfpUcBqY7AcjQtIvs70pdPMglNT3QeSGMzp9dxs31ZHCJhXjVX t5gBBAj1fvLEakpTj29YEQpvdu0fieT1EskkDOVGZvND2ZivH2ZsV1hlb6gMyMI3dxqPBFOBgGS4 G0mx5j2L_IedkrgUA5FqH.aVVh0GZnbrcZUHNyiqqG.GQUS_l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qEkLGcxGq9rN8Mv qULYEJxB3UJLvmR2S7AXup7opwKzI X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Fri, 11 Mar 2022 00:01:13 +0000 Received: by kubenode532.mail-prod1.omega.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 14d447c144378bdd823ae563645b8a4f; Fri, 11 Mar 2022 00:01:10 +0000 (UTC) From: Casey Schaufler To: casey.schaufler@intel.com, jmorris@namei.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Cc: casey@schaufler-ca.com, linux-audit@redhat.com, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, paul@paul-moore.com, stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org Subject: [PATCH v33 29/29] AppArmor: Remove the exclusive flag Date: Thu, 10 Mar 2022 15:46:32 -0800 Message-Id: <20220310234632.16194-30-casey@schaufler-ca.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220310234632.16194-1-casey@schaufler-ca.com> References: <20220310234632.16194-1-casey@schaufler-ca.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: John Johansen Reviewed-by: Kees Cook Signed-off-by: Casey Schaufler --- 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 1ee58c1491ab..388298a15556 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -1145,22 +1145,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 @@ -1264,8 +1248,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), @@ -1919,7 +1901,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.31.1