All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junxiao Bi <junxiao.bi@oracle.com>
To: linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-block@vger.kernel.org
Cc: paul@paul-moore.com, nathanl@linux.ibm.com, axboe@kernel.dk,
	jmorris@namei.org, serge@hallyn.com, konrad.wilk@oracle.com,
	joe.jin@oracle.com, junxiao.bi@oracle.com
Subject: [PATCH V4 2/2] blktrace: allow access trace file in lockdown mode
Date: Thu, 20 Apr 2023 14:53:31 -0700	[thread overview]
Message-ID: <20230420215331.88326-2-junxiao.bi@oracle.com> (raw)
In-Reply-To: <20230420215331.88326-1-junxiao.bi@oracle.com>

blktrace trace files are per-cpu relay files that are used by kernel to
export IO metadata(IO events, type, target disk, offset and len etc.) to
userspace, no data from IO itself will be exported. Bypass lockdown for
these files will make blktrace work in lockdown mode.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
---
 kernel/trace/blktrace.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index d5d94510afd3..e1a9f8b7d710 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -490,10 +490,16 @@ static struct dentry *blk_create_buf_file_callback(const char *filename,
 					&relay_file_operations);
 }
 
+static bool blk_bypass_lockdown(struct inode *inode)
+{
+	return true;
+}
+
 static const struct rchan_callbacks blk_relay_callbacks = {
 	.subbuf_start		= blk_subbuf_start_callback,
 	.create_buf_file	= blk_create_buf_file_callback,
 	.remove_buf_file	= blk_remove_buf_file_callback,
+	.bypass_lockdown	= blk_bypass_lockdown,
 };
 
 static void blk_trace_setup_lba(struct blk_trace *bt,
-- 
2.24.3 (Apple Git-128)


  reply	other threads:[~2023-04-20 21:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 21:53 [PATCH V4 1/2] debugfs: provide a way for relay user bypass lockdown Junxiao Bi
2023-04-20 21:53 ` Junxiao Bi [this message]
2023-04-25 17:55   ` [PATCH V4 2/2] blktrace: allow access trace file in lockdown mode Junxiao Bi
2023-04-25 19:12     ` Jens Axboe
2023-04-26 16:32       ` Junxiao Bi
2023-04-28 21:26         ` Paul Moore
2023-04-28 22:41           ` Junxiao Bi
2023-04-30 21:46             ` Paul Moore
2023-05-09 16:13               ` Junxiao Bi
2023-05-26 16:56                 ` Junxiao Bi
2023-05-26 21:37                   ` Paul Moore
2023-05-26 22:20                     ` Junxiao Bi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230420215331.88326-2-junxiao.bi@oracle.com \
    --to=junxiao.bi@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=jmorris@namei.org \
    --cc=joe.jin@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=nathanl@linux.ibm.com \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.