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:   Sun, 19 Apr 2020 19:45:28 +0000
From:   Luis Chamberlain <mcgrof@...nel.org>
To:     axboe@...nel.dk, viro@...iv.linux.org.uk, bvanassche@....org,
        gregkh@...uxfoundation.org, rostedt@...dmis.org, mingo@...hat.com,
        jack@...e.cz, ming.lei@...hat.com, nstange@...e.de,
        akpm@...ux-foundation.org
Cc:     mhocko@...e.com, yukuai3@...wei.com, linux-block@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH v2 09/10] block: panic if block debugfs dir is not created

If DEBUG_FS is disabled we have another inline
blk_debugfs_register() which just returns 0.

If BLK_DEV_IO_TRACE is enabled we rely on the block debugfs
directory to have been created. If BLK_DEV_IO_TRACE is not enabled
though, but if debugfs is still enabled we will always create a
debugfs directory for a request_queue. Instead of special-casing
this just for BLK_DEV_IO_TRACE, ensure this block debugfs dir is
always created at boot if we have enabled debugfs.

Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
 block/blk-debugfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/blk-debugfs.c b/block/blk-debugfs.c
index 761318dcbf40..d6ec980e7531 100644
--- a/block/blk-debugfs.c
+++ b/block/blk-debugfs.c
@@ -15,6 +15,8 @@ struct dentry *blk_debugfs_root;
 void blk_debugfs_register(void)
 {
 	blk_debugfs_root = debugfs_create_dir("block", NULL);
+	if (!blk_debugfs_root)
+		panic("Failed to create block debugfs directory\n");
 }
 
 int __must_check blk_queue_debugfs_register(struct request_queue *q)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ