Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1512927rwb; Tue, 27 Sep 2022 14:23:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4InWiZ2CFuTapOVEu38lP744CVJKwWvRgfhTZIpPlkMRsuIDoV/UBjgcnVGk/K1sav6Izr X-Received: by 2002:aa7:ce19:0:b0:457:d2e6:c49a with SMTP id d25-20020aa7ce19000000b00457d2e6c49amr2445906edv.49.1664313834733; Tue, 27 Sep 2022 14:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664313834; cv=none; d=google.com; s=arc-20160816; b=szvJLkKpHNtRFzdUC9lLFYFBqY5mNM8f6zDnPn+7JLtPMxdY4/gBAE09szwDxDOngj p7OSEtkNC01cnY4gbz6bpifhRrq3h4FSqKPuxRisNdbaWDVa6QO5+3prlhxNcd1I9WsA tTy9YGYHSwoH+s/dtlqT2vb3FDi+sR+EwV8E12OzjCfdj1Q0Q2qG5RFE+4akWRkzdqZg FxcVdGoBwG//wMqDpxhz/IUBDHVV+pgcEssfubXR5nGgJrDwjhj2k7cASKtB7lxafM8P ykj4jtMzu3qF/0WeCrD2Xqyg1xRZta5xhPz4B4twWwZ3WUyXf3qhgMhEN2R6fmIEg4jp R9TA== 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=679JJeCWRl08iYpbPXnnSN3ttJ/KDmIiDeSJeelJiow=; b=rnV0sDaE/auqEo8YzWCQTCj6LFanMGuhpJOtc3XkUJmD7YqGRMJU3YWB+g/oH+GWIg whNwV/KIczEqXE/9TZ9nZLkW4Mj5kCxHv2rMTc8q1Vm7q7C3cmkvL+Z00S/Rp/lb5cTl RUyyQ3BGO8W+5n84SnlSaFy/teZq3mgiw3nwdT0cPW0KSuUPNsABFBPKLdY/BhPqWZVd YOIt0jB8YdVZp1+iFuwUDGBcQpFbwX+Mz8+Colnjhlhpm3ejlOjpDUKKwtW4/UMPX17y UmIRC6jN1bMIOPZkUHqsei2oZhEnUcw/ExQ83tgr/XFV/tTnJyW72DwQbU9s13Y+e6zB bLYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=WYtfXFWI; 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 sh6-20020a1709076e8600b0078200e81b92si2233508ejc.758.2022.09.27.14.23.28; Tue, 27 Sep 2022 14:23:54 -0700 (PDT) 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=WYtfXFWI; 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 S231787AbiI0UPO (ORCPT + 99 others); Tue, 27 Sep 2022 16:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233020AbiI0UOO (ORCPT ); Tue, 27 Sep 2022 16:14:14 -0400 Received: from sonic304-28.consmr.mail.ne1.yahoo.com (sonic304-28.consmr.mail.ne1.yahoo.com [66.163.191.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71F3A1EAD73 for ; Tue, 27 Sep 2022 13:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1664309651; bh=679JJeCWRl08iYpbPXnnSN3ttJ/KDmIiDeSJeelJiow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=WYtfXFWIM82h6KHPBYUOPw+f53z6MqAiK/X8Yf4VoFeK+cUWcjvylz5YRy8x28Z0RHDRltPBSHCJOji1rrkINTvb0RTtOMEQ1dvkCjiPi9Ip5JZCHEhouShp+uOC2KbF4bvWtaUokO8fEAfktpqoHUoOFPzEI0mICDWMmmNRWuCoutCDTwXJKTqtezt9tgWOzRdUyE+0QlS/PkqOPvk4ILHorvk/4Rx6JHKJ1CnznFztVwmMaIyh0rNSCXelevM0H1vYsam5Gx0D/duoPzWbNrlgxZUi+Bpm8asJYlhdVJQUdJa1jShuXBlzVPYM1CEkbwGdEa4LxK7oWIRUcZ2ZTA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1664309651; bh=+8ohEcMls+wtK4Yy6rdUGFCUpXdLAWwUUIIhQpKrGqt=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=g0hBr2ix4bP9vaKBJA3j8zAf+/AAlO5cOXbqtM+h4QLueHW2KOHuywDlRF54KW+iRy60u8X/phYLVNTYQsPMPpqoFoOJDGVjUwj/QAdd4syonIThoAcOxPVWzkykX5XkpMFQQ5WzzA+o6orbOtUTZUUapDLo/GHXLHVk1E25ukyovtobnu0uan6Kr5mXSRa7FbUuyxcHPDF/azuHmA9P6d4pLrbMsi6x3aWW3seTkl9vV8GU6/GemFBVzm5I9DyohoTmUGeKK7wxPseKhq11Q3vBzzbLPdpN1NT5JfksuUJSqavh6SO4UweZV/rOq74Twk4Ac0knTczwhweCFTqbhg== X-YMail-OSG: D93IfIsVM1mKDwmH5sDPe_DoR1M.QM2jMmOBnb5BdsuWh7gd.crNxrkGivuNGUH P3HBfc4Qep8E.knDCnbSHzDY3wVx547vwVnL1BRCY6TTLWKM9LWoyBPA9G9jNfHJ_d51r_CvubgR 3QRELIzDoqKF.cfgnJ3XOHApzFvIAynVK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kp5.KWUAuGo_6Ayclo.52t65zngyfttOArCxeBvI0IL VOJLbYRSH.PyMCtCikTtLB5gZTpCX6rA9VVhuabY- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Tue, 27 Sep 2022 20:14:11 +0000 Received: by hermes--production-gq1-7dfd88c84d-65ptt (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 395ac973b3706d14ddbf652d9544c668; Tue, 27 Sep 2022 20:14:05 +0000 (UTC) From: Casey Schaufler To: casey.schaufler@intel.com, paul@paul-moore.com, linux-security-module@vger.kernel.org Cc: casey@schaufler-ca.com, linux-audit@redhat.com, jmorris@namei.org, selinux@vger.kernel.org, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org Subject: [PATCH v38 38/39] AppArmor: Remove the exclusive flag Date: Tue, 27 Sep 2022 12:54:20 -0700 Message-Id: <20220927195421.14713-39-casey@schaufler-ca.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220927195421.14713-1-casey@schaufler-ca.com> References: <20220927195421.14713-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,SPF_HELO_NONE,SPF_NONE 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 f47134da6723..284f74ba9af7 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -1168,22 +1168,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 @@ -1290,8 +1274,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), @@ -1954,7 +1936,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.37.3