Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1473878ybt; Thu, 18 Jun 2020 09:28:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/Ue5lHD81x+kmL3cu1e0LNfbivBOIsVnnwjFWlNn4H09QA6fFxcpcFz3pRqBfLZBnk4oP X-Received: by 2002:a17:906:6686:: with SMTP id z6mr4519850ejo.258.1592497712499; Thu, 18 Jun 2020 09:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592497712; cv=none; d=google.com; s=arc-20160816; b=DSWBUe/Vrscte945QyOFdH6K69nEOvA+yEcRekm57Jb8z9mEKQ4zWvTDCQPBNHxhoi BqiZem7NuLEcGJQF8uMaOEwCkOHxF6kxNaxw5VhDVUcfjsI2Lxo33w8ANbOEMjpMGnHD m53vdh6WOP7l/et5dU2l97Pmure1fCi2P/NBqxmUY3T4GscPBflZIPNQwLbE/GYDxyG2 AThnY0UXKbrf8TVLm8wDaV4oySopS1dpeupKXV4e3C+Dz6Q5tvgElIlMxmc59S+Ai8VS PvzcxN8fWcIN3thauFgkI15QJUQA2E9fmWuH10Zbqq+7m84HEtXnvOiH7xoJBaWCC/CG Ep1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=NzFKYFMSRdAt+rp39GoWz9kZ4vfH8xyxqZhx0tOR6sg=; b=NWcvA3fX8kk0YVhxgPadlRWppj+QUjUp0de7thn43bYUptHUsfvIr4Ov3M7YPx9xER n77FGpSuleFnJgm2ljfkGfMnk5IcIXxJ+fWGj8izhLX+/eJ3dOZcW9PNl7piLiHv7RcE U3t7WhcmED10wIL+lI2yeSay1PIij7okE1hYwb0tvtQ8JC5hk/76J1/Nc5yyapDANB39 cUfkyQmXg1uG1ejE9c0AaA62nLUVAgZOx1B6fNpBud7vKhiCRKtTTfk/V/44jtApt3ja OOVwRFFzpMHGlNKKCe3v2BZ/VNfw0VI913KGoRvD1Jwt3W/23APoVW8hH0iOerGumEai YD6A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si2220743ejc.318.2020.06.18.09.28.08; Thu, 18 Jun 2020 09:28:32 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730803AbgFRQXd (ORCPT + 99 others); Thu, 18 Jun 2020 12:23:33 -0400 Received: from mga06.intel.com ([134.134.136.31]:18458 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726981AbgFRQXb (ORCPT ); Thu, 18 Jun 2020 12:23:31 -0400 IronPort-SDR: DalMYkUIovDenS3rRjhBnn04QCEfuS7SBEGD9zcnk0jwaae60/mEfSUVKQbmeTnY+HcoYeIH5e gynoD7S6JRnA== X-IronPort-AV: E=McAfee;i="6000,8403,9656"; a="204130591" X-IronPort-AV: E=Sophos;i="5.75,251,1589266800"; d="scan'208";a="204130591" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2020 09:23:25 -0700 IronPort-SDR: qX7R8j79zmP2NjUAVlcMr1vg/ibC0ww/wL32qvXjjmErmo0tc+v8JyC55vN+zndnXIFsm7IoBV vT1ix66ELVOg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,251,1589266800"; d="scan'208";a="262970585" Received: from otc-nc-03.jf.intel.com (HELO otc-nc-03) ([10.54.39.25]) by orsmga007.jf.intel.com with ESMTP; 18 Jun 2020 09:23:22 -0700 Date: Thu, 18 Jun 2020 09:23:22 -0700 From: "Raj, Ashok" To: Greg Kroah-Hartman Cc: Rajat Jain , Andy Shevchenko , Christoph Hellwig , David Woodhouse , Lu Baolu , Joerg Roedel , Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , iommu@lists.linux-foundation.org, Linux Kernel Mailing List , linux-pci , ACPI Devel Maling List , "Krishnakumar, Lalithambika" , Mika Westerberg , Jean-Philippe Brucker , Prashant Malani , Benson Leung , Todd Broch , Alex Levin , Mattias Nissler , Rajat Jain , Bernie Keany , Aaron Durbin , Diego Rivas , Duncan Laurie , Furquan Shaikh , Jesse Barnes , Christian Kellner , Alex Williamson , Oliver O'Halloran , Jean-Philippe Brucker Subject: Re: [PATCH 4/4] pci: export untrusted attribute in sysfs Message-ID: <20200618162322.GI34820@otc-nc-03> References: <20200616011742.138975-4-rajatja@google.com> <20200616073249.GB30385@infradead.org> <20200617073100.GA14424@infradead.org> <20200618083646.GA1066967@kroah.com> <20200618160212.GB3076467@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200618160212.GB3076467@kroah.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, On Thu, Jun 18, 2020 at 06:02:12PM +0200, Greg Kroah-Hartman wrote: > On Thu, Jun 18, 2020 at 08:03:49AM -0700, Rajat Jain wrote: > > Hello, > > > > On Thu, Jun 18, 2020 at 2:14 AM Andy Shevchenko > > wrote: > > > > > > On Thu, Jun 18, 2020 at 11:36 AM Greg Kroah-Hartman > > > wrote: > > > > > > > > On Thu, Jun 18, 2020 at 11:12:56AM +0300, Andy Shevchenko wrote: > > > > > On Wed, Jun 17, 2020 at 10:56 PM Rajat Jain wrote: > > > > > > On Wed, Jun 17, 2020 at 12:31 AM Christoph Hellwig wrote: > > > > > > > > > > ... > > > > > > > > > > > (and likely call it "external" instead of "untrusted". > > > > > > > > > > Which is not okay. 'External' to what? 'untrusted' has been carefully > > > > > chosen by the meaning of it. > > > > > What external does mean for M.2. WWAN card in my laptop? It's in ACPI > > > > > tables, but I can replace it. > > > > > > > > Then your ACPI tables should show this, there is an attribute for it, > > > > right? > > > > > > There is a _PLD() method, but it's for the USB devices (or optional > > > for others, I don't remember by heart). So, most of the ACPI tables, > > > alas, don't show this. > > > > > > > > This is only one example. Or if firmware of some device is altered, > > > > > and it's internal (whatever it means) is it trusted or not? > > > > > > > > That is what people are using policy for today, if you object to this, > > > > please bring it up to those developers :) > > > > > > > > So, please leave it as is (I mean name). > > > > > > > > firmware today exports this attribute, why do you not want userspace to > > > > also know it? > > > > To clarify, the attribute exposed by the firmware today is > > "ExternalFacingPort" and "external-facing" respectively: > > > > 617654aae50e ("PCI / ACPI: Identify untrusted PCI devices") > > 9cb30a71ac45d("PCI: OF: Support "external-facing" property") > > > > The kernel flag was named "untrusted" though, hence the assumption > > that "external=untrusted" is currently baked into the kernel today. > > IMHO, using "external" would fix that (The assumption can thus be > > contained in the IOMMU drivers) and at the same time allow more use of > > this attribute. > > > > > > > > > > Trust is different, yes, don't get the two mixed up please. That should > > > > be a different sysfs attribute for obvious reasons. > > > > > > Yes, as a bottom line that's what I meant as well. > > > > So what is the consensus here? I don't have a strong opinion - but it > > seemed to me Greg is saying "external" and Andy is saying "untrusted"? > > Those two things are totally separate things when it comes to a device. Agree that these are two separate attributes, and better not mixed. > > One (external) describes the location of the device in the system. > > The other (untrusted) describes what you want the kernel to do with this > device (trust or not trust it). > > One you can change (from trust to untrusted or back), the other you can > not, it is a fixed read-only property that describes the hardware device > as defined by the firmware. The genesis is due to lack of a mechanism to establish if the device is trusted or not was the due lack of some specs and implementation around Component Measurement And Authentication (CMA). Treating external as untrusted was the best first effort. i.e trust internal devices and don't trust external devices for enabling ATS. But that said external is just describing topology, and if Linux wants to use that in the policy that's different. Some day external device may also use CMA to estabilish trust. FWIW even internal devices aren't trust worthy, except maybe RCIEP's. > > Depending on the policy you wish to define, you can use the location of > the device to determine if you want to trust the device or not. > Cheers, Ashok