lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <B5B678EA-303B-4F16-AD89-EE7C31AFC4ED@chromium.org>
Date:   Fri, 29 Oct 2021 07:30:48 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Zhenguo Zhao <zhenguo6858@...il.com>, nianfu.bai@...soc.com,
        anton@...msg.org, ccross@...roid.com, tony.luck@...el.com
CC:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] pstore: Add pstore back-end choice method in kconfig



On October 28, 2021 11:51:19 PM PDT, Zhenguo Zhao <zhenguo6858@...il.com> wrote:
>From: Zhenguo Zhao <Zhenguo.Zhao1@...soc.com>
>
>The pstore has one storage device for back-end,so it should be
>use choice method to config.
>
>When ramoops config,insmod pstore_blk.ko,it will print unexpected,the
>module will insmod failed.
>
>    if (backend && strcmp(backend, psi->name)) {
>        pr_warn("ignoring unexpected backend '%s'\n", psi->name);
>        return -EPERM;
>    }

This is by design: all the backends can be built as modules, and each can be loaded and unloaded as desired. If it's a "choice" only one can be built at a time.

-Kees


>
>Signed-off-by: Zhenguo Zhao <Zhenguo.Zhao1@...soc.com>
>---
> fs/pstore/Kconfig | 57 ++++++++++++++++++++++++++++++-------------------------
> 1 file changed, 31 insertions(+), 26 deletions(-)
>
>diff --git a/fs/pstore/Kconfig b/fs/pstore/Kconfig
>index 8adabde..288ed3c 100644
>--- a/fs/pstore/Kconfig
>+++ b/fs/pstore/Kconfig
>@@ -146,21 +146,40 @@ config PSTORE_FTRACE
> 
> 	  If unsure, say N.
> 
>-config PSTORE_RAM
>-	tristate "Log panic/oops to a RAM buffer"
>+choice
>+	prompt "Choice pstore device"
> 	depends on PSTORE
>-	depends on HAS_IOMEM
>-	select REED_SOLOMON
>-	select REED_SOLOMON_ENC8
>-	select REED_SOLOMON_DEC8
>+	default PSTORE_RAM
> 	help
>-	  This enables panic and oops messages to be logged to a circular
>-	  buffer in RAM where it can be read back at some later point.
>-
>-	  Note that for historical reasons, the module will be named
>-	  "ramoops.ko".
>+	  This option chooses ram or blk to use pstore device.
>+	config PSTORE_RAM
>+		tristate "Log panic/oops to a RAM buffer"
>+		depends on HAS_IOMEM
>+		select REED_SOLOMON
>+		select REED_SOLOMON_ENC8
>+		select REED_SOLOMON_DEC8
>+		help
>+		  This enables panic and oops messages to be logged to a circular
>+		  buffer in RAM where it can be read back at some later point.
>+
>+		  Note that for historical reasons, the module will be named
>+		  "ramoops.ko".
>+
>+		  For more information, see Documentation/admin-guide/ramoops.rst.
>+
>+	config PSTORE_BLK
>+		tristate "Log panic/oops to a block device"
>+		depends on BLOCK
>+		select PSTORE_ZONE
>+		help
>+		  This enables panic and oops message to be logged to a block dev
>+		  where it can be read back at some later point.
>+
>+		  For more information, see Documentation/admin-guide/pstore-blk.rst
>+
>+		  If unsure, say N.
> 
>-	  For more information, see Documentation/admin-guide/ramoops.rst.
>+endchoice
> 
> config PSTORE_ZONE
> 	tristate
>@@ -169,20 +188,6 @@ config PSTORE_ZONE
> 	  The common layer for pstore/blk (and pstore/ram in the future)
> 	  to manage storage in zones.
> 
>-config PSTORE_BLK
>-	tristate "Log panic/oops to a block device"
>-	depends on PSTORE
>-	depends on BLOCK
>-	select PSTORE_ZONE
>-	default n
>-	help
>-	  This enables panic and oops message to be logged to a block dev
>-	  where it can be read back at some later point.
>-
>-	  For more information, see Documentation/admin-guide/pstore-blk.rst
>-
>-	  If unsure, say N.
>-
> config PSTORE_BLK_BLKDEV
> 	string "block device identifier"
> 	depends on PSTORE_BLK

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ