Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp75716pxb; Tue, 31 Aug 2021 15:30:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAhhz6F+7YINt5L1QH3MOii7wICr8mbRSMIzADgjdLirFx73QAfQoEvJ8XVR+dCWMs3EzD X-Received: by 2002:a50:ff19:: with SMTP id a25mr30706057edu.311.1630449018507; Tue, 31 Aug 2021 15:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630449018; cv=none; d=google.com; s=arc-20160816; b=yVSb9s41zsb0RryjShRdKKBj22EIRRdyDAYwtsJTqCCbrjgRhKdIURlnTMpVkIXe7O MNIR83hm4h/4Pdl8xwXY2O+hFe8esTOE7RrWM57zHG1mS23UXPHTrJEaM92TvzwA5s0N 4m2xoPPHm6fWeDeXbtdZgZLkrRhtOBJRPerqTVxxP6w9jzfTb4QO/LKmYhfr0E5Kpc2f bVf4QgtMxgxr3flsKv27vNVr2Xn1BGHD/0HJIGZV0ObY/GBgfJ5bBDslt3gntcGEEpn6 xXpco8cnDHXS93qOYfcRSncgZac3zOfYYhEFw7vf4hDHq/IsUVTCuvNJz0K6aDDNWRsj ufuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=K4O58ZgiMsf0cCMtsvw/t7AJFM1T3tlDvm3uUGsU/to=; b=uwIVJCGkVNimtzxkj49qd8FUreHWDkWd/B9Vr12D7rgRbMB2Mhbyt4U4825O8VxcVA 9S2I2K0pxJ/bWr9FhNZnq+VgEw+BZ4xj08b1DhvkN9Ct61z06D0HAiyutLiOFALAw742 ZjxUx1ziSmV+OfMaZqCO+jE3BO5gafSCxyzBSDIdvfQBSV2aEX0Iaeawdi1crJY/SuHB WyksVWPhWcByuZ1/E3Mssg7mtYi3BFGRR3dbnSQcsMkGZq5NnJZ0qTq1p4HOvK5YSsMi rMdHwik3i0IWGcEUeU2ZGTTiCFBji73u6YCsd9WdnT/E7WRRZqoxfeq7pIZONabS9+f5 A/ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b="m/p6PQxM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n9si18077523ejj.544.2021.08.31.15.29.54; Tue, 31 Aug 2021 15:30:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b="m/p6PQxM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239608AbhHaTAo (ORCPT + 99 others); Tue, 31 Aug 2021 15:00:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239540AbhHaTAk (ORCPT ); Tue, 31 Aug 2021 15:00:40 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B39CC0617AD for ; Tue, 31 Aug 2021 11:59:44 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id i21so1043910ejd.2 for ; Tue, 31 Aug 2021 11:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=K4O58ZgiMsf0cCMtsvw/t7AJFM1T3tlDvm3uUGsU/to=; b=m/p6PQxMro/Ee7fR7WvozEwx71BnscpCpL2xs1XR6unVL7bfCWki5mm/DL8tzkxtlv IgmDAUJlZv7+KUUNuYAb3NRkVROzdUIxdGRwwrqEOUO0vD6Cu/HZq+bSFieTd9983AeD YktyhmMz20Tq1h8uROtJTQQFwlHuUy+Bds8+ZIoQqHDYDTRBZ7xIrXRop6SBBaMcqz3D KSsC4i4L46l25F26x2rXCk4fmowpOEt5kNPUpUjO3ZN5jtoqzJulRjdNVM64Yw8ZBWOt rXYGE77kjE3hfKV3j/NE4j8c0xfhsFszf/XJGAR6u3atTQlztdBXyq7sYYSIi6VfUO2y mhuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K4O58ZgiMsf0cCMtsvw/t7AJFM1T3tlDvm3uUGsU/to=; b=EgVMaskm9kd9YHf2R+Qv8YKL1ke5WdkaeKA6Wuv53cdmd86f6m36fO315JN6fKgGzV laSaQUm3Mc+Q9Q5pDddabRNevLAwQSN7iUWevyLiuDwkQA9pJymye3xndnQrJG/zBPWe KEripYJ/Hj/L2TaTSx9LvC/Ex95IQu9pU3uI6uI4BteD2xAIKZ2TI2Jd5nQL4Ia3VE4O 4+lZxlDF+Jg/wMU5RXWFsR/IowhnmBIjhBs4Wu7vOFelg5qTHLSq77JnsH3+GPWN/4TG oJ8lPrDO+YSS0aOy1H3N8kYzYTVeu6ebUuvux28G5EJQhXMUjg+RvJXPsPsM+vVXtNun jjvA== X-Gm-Message-State: AOAM5313YY8yOhNK9C9vuO0aRsns9HX2+CPrxd3/OqZgsQzUx8LT8xk6 Hc8ch0v3syghp8ZahRhRqsJgmYOG2LvihkbszwpL X-Received: by 2002:a17:906:2cd6:: with SMTP id r22mr31706715ejr.398.1630436382385; Tue, 31 Aug 2021 11:59:42 -0700 (PDT) MIME-Version: 1.0 References: <20210616085118.1141101-1-omosnace@redhat.com> In-Reply-To: From: Paul Moore Date: Tue, 31 Aug 2021 14:59:31 -0400 Message-ID: Subject: Re: [PATCH v3] lockdown,selinux: fix wrong subject in some SELinux lockdown checks To: Dan Williams Cc: Ondrej Mosnacek , Linux Security Module list , James Morris , Steven Rostedt , Ingo Molnar , Steffen Klassert , Herbert Xu , "David S . Miller" , Stephen Smalley , SElinux list , linuxppc-dev , X86 ML , Linux ACPI , linux-cxl@vger.kernel.org, linux-efi , linux-fsdevel , Linux PCI , Linux-pm mailing list , linux-serial@vger.kernel.org, bpf , Netdev , Kexec Mailing List , Linux Kernel Mailing List , Casey Schaufler Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 31, 2021 at 2:58 PM Dan Williams wrote: > On Tue, Aug 31, 2021 at 6:53 AM Paul Moore wrote: > > On Tue, Aug 31, 2021 at 5:09 AM Ondrej Mosnacek wrote: > > > On Sat, Jun 19, 2021 at 12:18 AM Dan Williams wrote: > > > > On Wed, Jun 16, 2021 at 1:51 AM Ondrej Mosnacek wrote: > > > > ... > > > > > > > diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c > > > > > index 2acc6173da36..c1747b6555c7 100644 > > > > > --- a/drivers/cxl/mem.c > > > > > +++ b/drivers/cxl/mem.c > > > > > @@ -568,7 +568,7 @@ static bool cxl_mem_raw_command_allowed(u16 opcode) > > > > > if (!IS_ENABLED(CONFIG_CXL_MEM_RAW_COMMANDS)) > > > > > return false; > > > > > > > > > > - if (security_locked_down(LOCKDOWN_NONE)) > > > > > + if (security_locked_down(current_cred(), LOCKDOWN_NONE)) > > > > > > > > Acked-by: Dan Williams > > > > > > > > ...however that usage looks wrong. The expectation is that if kernel > > > > integrity protections are enabled then raw command access should be > > > > disabled. So I think that should be equivalent to LOCKDOWN_PCI_ACCESS > > > > in terms of the command capabilities to filter. > > > > > > Yes, the LOCKDOWN_NONE seems wrong here... but it's a pre-existing bug > > > and I didn't want to go down yet another rabbit hole trying to fix it. > > > I'll look at this again once this patch is settled - it may indeed be > > > as simple as replacing LOCKDOWN_NONE with LOCKDOWN_PCI_ACCESS. > > > > At this point you should be well aware of my distaste for merging > > patches that have known bugs in them. Yes, this is a pre-existing > > condition, but it seems well within the scope of this work to address > > it as well. > > > > This isn't something that is going to get merged while the merge > > window is open, so at the very least you've got almost two weeks to > > sort this out - please do that. > > Yes, apologies, I should have sent the fix shortly after noticing the > problem. I'll get the CXL bug fix out of the way so Ondrej can move > this along. Thanks Dan. -- paul moore www.paul-moore.com