Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp731827pxb; Tue, 2 Feb 2021 17:01:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxiig7eAl4ZWrQzEMdNOVNCMhvCJjGubO/Fk59Be6Zh7Fxji8XbX3dzvpxZK8bLuCkvyRkB X-Received: by 2002:a17:906:a106:: with SMTP id t6mr648402ejy.63.1612314067145; Tue, 02 Feb 2021 17:01:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612314067; cv=none; d=google.com; s=arc-20160816; b=jzCuN4odMXUPH+HUCzsgbsm7GeEpdrCTsuP9aQ/54FjslZxCOByBq8n6cgtSULVN9O tc+SF0ZIiQRW2mEYT2muJn4gARiFTGIAhdhysphvpWu2mMVU2qX4mKZyYLgrLN+l2c/a 5E0UWsfm3SU30eVixZ2ozlmmrFbii8i8fQpo60MAIpUK/CKfpjBe08OsSQ3FKBDlnHxG Lj+/f9IGxPZz7yJ9WVe1c5Uz0RJLsLPx9dEi4RM6SALHa8quf2gghilsjTW3BLRSvFde crT469IQuOfGJkqnQf9l6Xmt9U1jefX81+hehNtBuFbs8u3NQxVqQ/4+YfdFr5ZASRGA QsAA== 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=8ei7hzPsgvHgxY53PqUfsTxtC6XeuV2PKdJfigEzcdI=; b=pBPuw2SidD0NgRjlPME313siBMqFg315tCj+wptx1o1/hYQcz7LyH5B5/FA4jCvnD2 BZvbdYOQIxGR2bUO6iUSdPDFH4XAPMGKY0gMg4gZgJU/CMAG9qMWmFsW+/M/tQGMRyIY Bg94kZqtM3pmOo+hE67fIbTE75WA3HseslxE3V30JzA+Y2OPgypgYfGLoeRTExBgwVNT tCSmmez0vPb5mzads3EEfGUkpZPhoMSLxUKhY/ymipIEv5CndbKu20CYEa4C3midAoJl m/cYr9Wt6pohhB/US2wDJ/wPUrc0qgxGnTvuN7NI2N0XI8TYK+aJMcOcXj3OS0UncjVF 33ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=mzBF5mEs; 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 bk4si300382ejb.448.2021.02.02.17.00.43; Tue, 02 Feb 2021 17:01:07 -0800 (PST) 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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=mzBF5mEs; 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 S231395AbhBBX5x (ORCPT + 99 others); Tue, 2 Feb 2021 18:57:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbhBBX5r (ORCPT ); Tue, 2 Feb 2021 18:57:47 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A21C061788 for ; Tue, 2 Feb 2021 15:57:06 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id hs11so32783008ejc.1 for ; Tue, 02 Feb 2021 15:57:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8ei7hzPsgvHgxY53PqUfsTxtC6XeuV2PKdJfigEzcdI=; b=mzBF5mEs8+7DFtT3HTRtRwBqdt+He1ge0SMWWG8XkrU4j3buin9RWxFI80NU1dbq/R /WLbqer0SbWlVjMvaJu8gx57DMPD9tzGQQF+a3hKcNHSjouwn82qB4ZWZcmbSuMgp9QE 9S6NwSapDuZl2RcO5BNqKzDgJeGii59VEjCP8ylXYrcdeS2mK8609qBkeYKPEA85A/XM 3Rd5vrV43Hxg2OmRr6UcKmh+9goio20mf2HCQz2M2p0H1sRaYgxs3Q/lCUojUG+I8kWT pxnhEpwitUxifLzlm2ksMzc+MnXqrZGtV0guUtXY0v4eLpikf6uL5iOMNfwyslLvg+36 Ztvg== 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=8ei7hzPsgvHgxY53PqUfsTxtC6XeuV2PKdJfigEzcdI=; b=teIBfea8EnKbf5SPIg7Vdu+ONcHTgkJX2bfpPHXgx3PvD3J4X8IGAVZ9b/qTdcXQT9 NVA5wWjYCzWnX9pNsdNNtuuqH9MaMNCuwntV7UIHmvUipUAzDxUxAra+qicaz7ZttaXp NdhS1SEBz+kkkNTbOUCKHP/o00oe70TtQhfp5f8dgAcauKuV6RhAqBuV7h99vg2kQb64 ZdPh9ukWRBGqNsCXeYGt/uYiEvmRPSSG4apZyGB2Kpx6hsw21rmguMGRBHXO9RRbrh2r GNZB0RYJo+Fucy5TsKiE77jDh4sZ5ej/i9k9TiZyD2Pr52/Z8jRtK2Ey56K8RMXnvxtn faOg== X-Gm-Message-State: AOAM531+h/gVAi+uA2b1xC9hWUSluCs89bEzdHDZRVocsRCSt4uf71XN MJdgL0rFhr5j9ae67ob8/tbIEo3/QUhg7hGkOYK7j2R+SaQ= X-Received: by 2002:a17:906:d8a1:: with SMTP id qc1mr440588ejb.523.1612310224889; Tue, 02 Feb 2021 15:57:04 -0800 (PST) MIME-Version: 1.0 References: <20210130002438.1872527-1-ben.widawsky@intel.com> <20210130002438.1872527-14-ben.widawsky@intel.com> <20210201182848.GL197521@fedora> <20210202235103.v36v3znh5tsi4g5x@intel.com> In-Reply-To: <20210202235103.v36v3znh5tsi4g5x@intel.com> From: Dan Williams Date: Tue, 2 Feb 2021 15:57:03 -0800 Message-ID: Subject: Re: [PATCH 13/14] cxl/mem: Add limited Get Log command (0401h) To: Ben Widawsky Cc: Konrad Rzeszutek Wilk , linux-cxl@vger.kernel.org, Linux ACPI , Linux Kernel Mailing List , linux-nvdimm , Linux PCI , Bjorn Helgaas , Chris Browy , Christoph Hellwig , Ira Weiny , Jon Masters , Jonathan Cameron , Rafael Wysocki , Randy Dunlap , Vishal Verma , daniel.lll@alibaba-inc.com, "John Groves (jgroves)" , "Kelley, Sean V" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 2, 2021 at 3:51 PM Ben Widawsky wrote: > > On 21-02-01 13:28:48, Konrad Rzeszutek Wilk wrote: > > On Fri, Jan 29, 2021 at 04:24:37PM -0800, Ben Widawsky wrote: > > > The Get Log command returns the actual log entries that are advertised > > > via the Get Supported Logs command (0400h). CXL device logs are selected > > > by UUID which is part of the CXL spec. Because the driver tries to > > > sanitize what is sent to hardware, there becomes a need to restrict the > > > types of logs which can be accessed by userspace. For example, the > > > vendor specific log might only be consumable by proprietary, or offline > > > applications, and therefore a good candidate for userspace. > > > > > > The current driver infrastructure does allow basic validation for all > > > commands, but doesn't inspect any of the payload data. Along with Get > > > Log support comes new infrastructure to add a hook for payload > > > validation. This infrastructure is used to filter out the CEL UUID, > > > which the userspace driver doesn't have business knowing, and taints on > > > invalid UUIDs being sent to hardware. > > > > Perhaps a better option is to reject invalid UUIDs? > > > > And if you really really want to use invalid UUIDs then: > > > > 1) Make that code wrapped in CONFIG_CXL_DEBUG_THIS_IS_GOING_TO..? > > > > 2) Wrap it with lockdown code so that you can't do this at all > > when in LOCKDOWN_INTEGRITY or such? > > > > The commit message needs update btw as CEL is allowed in the latest rev of the > patches. > > We could potentially combine this with the now added (in a branch) CONFIG_RAW > config option. Indeed I think that makes sense. Dan, thoughts? Yeah, unknown UUIDs blocking is the same risk as raw commands as a vendor can trigger any behavior they want. A "CONFIG_RAW depends on !CONFIG_INTEGRITY" policy sounds reasonable as well.