Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1415166pxb; Fri, 10 Sep 2021 05:33:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiXgLjp03V5nCGTqnCeQJI+CXmDwsogCGO97qMBUf5IDHoM5aPHYGtiRmcBMaT/gV9TX3R X-Received: by 2002:a05:6e02:1a8a:: with SMTP id k10mr6030755ilv.1.1631277231299; Fri, 10 Sep 2021 05:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631277231; cv=none; d=google.com; s=arc-20160816; b=Bl17CSQmoD4f7CdDBa4Iv3Pdqq7+r6w5ZG956zcpoSc1lxxGfmjsM5NqETbkjUA5k0 MtibEeRjO0MYr9uqk644gFHAidI5aE37RWKymN3/EDsfccScDZYKJaNosMH1/HFk4zLW DDDGUONGXKq63IdOWXvQI6PlLkWOhxJ0Y2VvHmGA9cdnMXhX8WWfOkNPm2VTc4X3CcLI WRIdKhGfA7ZA2tba0NLEYG1ifu4qEIMHUiOes9lxRk0RSElzpuMCFARCCx8HNMXCMW3B eYK6nRrwc9V9u/HnItp+/00MNk4xiRwTa7boA2i8x84XpIC/l9Ef31cO080kn3mJj/3s 43uQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mGey5iofo0bM0S6u6Jn+tgdLNvBVFQMa5J3gIeIj874=; b=TDrr1mL4lSrEF0dm3xKXt5q0Dmboa+dHMFaUNgqwAbu7S3JCKEAPseMg/Lf3EwwHWU aWghod1VMTTyU+jo1Lue9SCwWX/X4Uc6PAlECbMwKiSUT/28nxo8h1cQsQhzzGSZywEX JDJFtUHGgU5LCKGinh37zzHfyUY4jpbVwphAPVoDvaZz3R9/qQMDJORcEbZ/2shtq3Hw 3UzUfMaw1OFpO8xHAsO9lOlffslI3ZmCxDBTO+PHUjuM6DbSBc618y+bWARGt4DMsKAk 9W2SiEWrf0E7fWR0NbmODQb5Uv/u8fQ1T/173bMZNwukeomHCdTjLGJKaYB6yoQAwM22 mtAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x6JsnrwI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si4615425ils.74.2021.09.10.05.33.38; Fri, 10 Sep 2021 05:33:51 -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=@linuxfoundation.org header.s=korg header.b=x6JsnrwI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233412AbhIJMcm (ORCPT + 99 others); Fri, 10 Sep 2021 08:32:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:50014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233367AbhIJMck (ORCPT ); Fri, 10 Sep 2021 08:32:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F507611C9; Fri, 10 Sep 2021 12:31:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631277089; bh=WFWK/09lBNfAtxGfozjNZrWrz3JqIkV9UdcgteRxojk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x6JsnrwIwo34186PKX2dsU04+9tvNEmu5Alp9QL/LcKqAmCxk8MbKc5O3+wkOX7C7 JT6rFR9o+KOLgr7lCga8JBIBhJor6FPCz0IFS6P3yfVS27JrbEE/ZUPcekfiGjiteP WWD6OjsBvUUv+blmXpppENK7Qc/QmlW929tIYML0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Widawsky , Jonathan Cameron , Ondrej Mosnacek , Paul Moore , Dan Williams Subject: [PATCH 5.14 22/23] cxl/pci: Fix lockdown level Date: Fri, 10 Sep 2021 14:30:12 +0200 Message-Id: <20210910122916.709969307@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910122916.022815161@linuxfoundation.org> References: <20210910122916.022815161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Williams commit 9e56614c44b994b78fc9fcb2070bcbe3f5df0d7b upstream. A proposed rework of security_locked_down() users identified that the cxl_pci driver was passing the wrong lockdown_reason. Update cxl_mem_raw_command_allowed() to fail raw command access when raw pci access is also disabled. Fixes: 13237183c735 ("cxl/mem: Add a "RAW" send command") Cc: Ben Widawsky Cc: Jonathan Cameron Cc: Cc: Ondrej Mosnacek Cc: Paul Moore Link: https://lore.kernel.org/r/163072204525.2250120.16615792476976546735.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- drivers/cxl/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -568,7 +568,7 @@ static bool cxl_mem_raw_command_allowed( if (!IS_ENABLED(CONFIG_CXL_MEM_RAW_COMMANDS)) return false; - if (security_locked_down(LOCKDOWN_NONE)) + if (security_locked_down(LOCKDOWN_PCI_ACCESS)) return false; if (cxl_raw_allow_all)