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: <20201016132047.3068029-10-hch@lst.de>
Date:   Fri, 16 Oct 2020 15:20:47 +0200
From:   Christoph Hellwig <hch@....de>
To:     Kees Cook <keescook@...omium.org>,
        Anton Vorontsov <anton@...msg.org>,
        Colin Cross <ccross@...roid.com>,
        Tony Luck <tony.luck@...el.com>,
        WeiXiong Liao <liaoweixiong@...winnertech.com>
Cc:     linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH 9/9] pstore/blk: don't depend on CONFIG_BLOCK

pstore-blk contains of two different layers:

 a) a tiny layer of sugar coating ontop of pstore-zone.  This part has
    no dependencies on the block layer, and can be used e.g. by mtd
 b) an implementation of a default fallback pstore zone backend for
    block devices

Add an ifdef for the latter so that pstore-blk itself does not have to
depend on CONFIG_BLOCK.

Signed-off-by: Christoph Hellwig <hch@....de>
---
 fs/pstore/Kconfig | 2 +-
 fs/pstore/blk.c   | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/pstore/Kconfig b/fs/pstore/Kconfig
index e16a49ebfe546d..6eadb538316e52 100644
--- a/fs/pstore/Kconfig
+++ b/fs/pstore/Kconfig
@@ -164,7 +164,7 @@ config PSTORE_ZONE
 config PSTORE_BLK
 	tristate "Log panic/oops to a block device"
 	depends on PSTORE
-	depends on BLOCK
+	depends on BLOCK || !BLOCK
 	select PSTORE_ZONE
 	default n
 	help
diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c
index bd4eadfc9bd795..d3d25edb943cdd 100644
--- a/fs/pstore/blk.c
+++ b/fs/pstore/blk.c
@@ -182,6 +182,7 @@ void unregister_pstore_device(const struct pstore_zone_ops *ops)
 }
 EXPORT_SYMBOL_GPL(unregister_pstore_device);
 
+#ifdef CONFIG_BLOCK
 static struct file *psblk_file;
 
 static ssize_t psblk_generic_blk_read(char *buf, size_t bytes, loff_t pos)
@@ -269,6 +270,7 @@ void __init pstore_blk_early_init(void)
 	__pstore_blk_init(devname);
 }
 #endif /* MODULE */
+#endif /* CONFIG_BLOCK */
 
 /* get information of pstore/blk */
 int pstore_blk_get_config(struct pstore_blk_config *info)
-- 
2.28.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ