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]
Date:   Fri, 24 Sep 2021 16:59:21 +0800
From:   Zhenguo Zhao <zhenguo6858@...il.com>
To:     nianfu.bai@...soc.com, keescook@...omium.org, anton@...msg.org,
        ccross@...roid.com, tony.luck@...el.com
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] pstore: Add pstore back-end choice method in kconfig

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;
    }

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
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ