Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3410292ybt; Tue, 30 Jun 2020 01:59:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzcs6tqbKLR1tdaNt19RGGMlYtcxEmDnd8mqGd7uSDaGUwclELINi7k8WikwqrLvIi4LI6 X-Received: by 2002:a17:906:fa92:: with SMTP id lt18mr5595591ejb.534.1593507556167; Tue, 30 Jun 2020 01:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593507556; cv=none; d=google.com; s=arc-20160816; b=bM+hcFQUl1tC819D1Ahny8JLSbe/gNctpkvnhPECY4WepctuGMLjdg6ipazlAKFhF3 MqFaraDbPyzlux8zYzpdN36M3T6+c0QliMdDzmy8uBFp23wU68ayiUXrK99risa+ZD8b Qkuv2fomVrDfOdMoAHcWCbGNHDxCzjezujQK6Xhtsi+XIjeV6eag4KB71soOYyrGS+LO 4oe6PtwIqpUNIPEsaGvs/t6oQ1kjDzBKP9wNEKgWaZTJSgJQErKEUpf2u4GgXU5ZUKbQ /WTsWb42P23eS81W6NVuODcLuRrZs+DEbdEgP5eiSnt5anwl/CmMgnEQUM0Fez27KNhN HRVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=S3NNo0cA0eAyko+tutCwuF+i5Ao/q46TqASstMjYlGI=; b=TkIzQDMS0B2rxDuhr2Fj5tP+XQ8pZ7e5FnkscnmPkEcIIlFTO7z3i1pVUklKsjA6bM e8Fo4gm31BKLs5/mTnvgWQDT9WisQUu+pCNZbYWkcx7kOpHdaBWr4drbR7BgOlXd/Wuq QPnXa9XmAKNTuLqsAcSsTng3vdam/KBuxcdaYPPkx/khTJJEBXHK+Fr6pXcZ5Ja0NDdr q+wx5vb6bj1z3zQ5nkGC9EIty/iVQRJzjEdfzgMv8sxEv+NmZ/lxiPMnaYVWKqXq9pId PIHqYux+MPUc/4v9W8S2nHbOumPQvel3uTuCJvsix1w6lIATmk246PI6igr69XVCN8l7 pRYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sORZvxL8; 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 j31si1376803edc.371.2020.06.30.01.58.53; Tue, 30 Jun 2020 01:59:16 -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=@kernel.org header.s=default header.b=sORZvxL8; 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 S1731646AbgF3I4q (ORCPT + 99 others); Tue, 30 Jun 2020 04:56:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:56698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729992AbgF3I4p (ORCPT ); Tue, 30 Jun 2020 04:56:45 -0400 Received: from localhost (unknown [84.241.197.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 544B220759; Tue, 30 Jun 2020 08:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593507405; bh=RMkfOv+c5EL2QlsPXrFbfPa5buPm5V8aN83cTazCr9s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sORZvxL8YlMIovX+fTWnmJeH68eF70iC78FC6rsnRerQnoEzU9MGmg4rOEWWS5RvC 0Z3kPFW6XcRofM0kLRef2FUs9aES0j3+1rOdb5JAeT2bs4iShNlnkg9EuHDXDT/T+n JI1+Zdsxm3TAYyyirQ/hC2Se4wpZQVq5B12o2NGU= Date: Tue, 30 Jun 2020 10:56:41 +0200 From: Greg Kroah-Hartman To: Daniel Gutson Cc: Derek Kiernan , Arnd Bergmann , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Richard Hughes , Alex Bazhaniuk Subject: Re: [PATCH] SPI LPC information kernel module Message-ID: <20200630085641.GD637809@kroah.com> References: <20200629225932.5036-1-daniel.gutson@eclypsium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200629225932.5036-1-daniel.gutson@eclypsium.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 07:59:32PM -0300, Daniel Gutson wrote: > This kernel module exports configuration attributes for the > system SPI chip. > This initial version exports the BIOS Write Enable (bioswe), > BIOS Lock Enable (ble), and the SMM Bios Write Protect (SMM_BWP) > fields of the Bios Control register. The idea is to keep adding more > flags, not only from the BC but also from other registers in following > versions. > > The goal is that the attributes are avilable to fwupd when SecureBoot > is turned on. > > A technical note: I check if *ppos == BUFFER_SIZE in the reading function > to exit early and avoid an extra access to the HW, for example when using > the 'cat' command, which causes two read operations. Why not use the simple_* functions which should prevent that type of thing? > > Signed-off-by: Daniel Gutson > --- > Documentation/ABI/stable/securityfs-spi-lpc | 23 + Why is this going in securityfs at all? Why not just sysfs as it is a CPU attribute, right? > MAINTAINERS | 6 + > drivers/misc/Kconfig | 1 + > drivers/misc/Makefile | 1 + > drivers/misc/spi_lpc/Kconfig | 20 + > drivers/misc/spi_lpc/Makefile | 8 + > drivers/misc/spi_lpc/bios_data_access.c | 559 +++++++++++++++++++ > drivers/misc/spi_lpc/bios_data_access.h | 181 +++++++ > drivers/misc/spi_lpc/low_level_access.c | 59 ++ > drivers/misc/spi_lpc/low_level_access.h | 21 + > drivers/misc/spi_lpc/spi_lpc_main.c | 176 ++++++ > drivers/misc/spi_lpc/viddid_arch_map.c | 566 ++++++++++++++++++++ > drivers/misc/spi_lpc/viddid_arch_map.h | 17 + > 13 files changed, 1638 insertions(+) > create mode 100644 Documentation/ABI/stable/securityfs-spi-lpc > create mode 100644 drivers/misc/spi_lpc/Kconfig > create mode 100644 drivers/misc/spi_lpc/Makefile > create mode 100644 drivers/misc/spi_lpc/bios_data_access.c > create mode 100644 drivers/misc/spi_lpc/bios_data_access.h > create mode 100644 drivers/misc/spi_lpc/low_level_access.c > create mode 100644 drivers/misc/spi_lpc/low_level_access.h > create mode 100644 drivers/misc/spi_lpc/spi_lpc_main.c > create mode 100644 drivers/misc/spi_lpc/viddid_arch_map.c > create mode 100644 drivers/misc/spi_lpc/viddid_arch_map.h > > diff --git a/Documentation/ABI/stable/securityfs-spi-lpc b/Documentation/ABI/stable/securityfs-spi-lpc > new file mode 100644 > index 000000000000..22660a7fd914 > --- /dev/null > +++ b/Documentation/ABI/stable/securityfs-spi-lpc > @@ -0,0 +1,23 @@ > +What: /sys/kernel/security/firmware/bioswe > +Date: June 2020 > +KernelVersion: 5.8.0 > +Contact: daniel.gutson@eclypsium.com > +Description: If the system firmware set BIOS Write Enable. > + 0: writes disabled, 1: writes enabled. THis is very x86-specific, what about ARM/MIPS/anything else? Perhaps a cpu/arch-specific thing instead? Again, which makes it seem like securityfs is not the thing for this, as it describes the hardware, not a security model which is what securityfs has been for in the past, right? thanks, greg k-h