From: Paul Moore <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>,
[email protected], [email protected],
[email protected], Arnd Bergmann <[email protected]>,
Luis Chamberlain <[email protected]>
Subject: Re: [PATCH 3/3] /dev/null: add IORING_OP_URING_CMD support
Date: Tue, 23 Aug 2022 13:02:43 -0400 [thread overview]
Message-ID: <CAHC9VhRiTDqL-EtUcJ9y8nzRPk2BAfGzWK97oe56Ld4KyZsmGg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
On Tue, Aug 23, 2022 at 9:33 AM Jens Axboe <[email protected]> wrote:
> On 8/23/22 12:51 AM, Greg Kroah-Hartman wrote:
> > On Mon, Aug 22, 2022 at 05:21:19PM -0400, Paul Moore wrote:
> >> This patch adds support for the io_uring command pass through, aka
> >> IORING_OP_URING_CMD, to the /dev/null driver. As with all of the
> >> /dev/null functionality, the implementation is just a simple sink
> >> where commands go to die, but it should be useful for developers who
> >> need a simple IORING_OP_URING_CMD test device that doesn't require
> >> any special hardware.
> >>
> >> Cc: Arnd Bergmann <[email protected]>
> >> Cc: Greg Kroah-Hartman <[email protected]>
> >> Signed-off-by: Paul Moore <[email protected]>
> >> ---
> >> drivers/char/mem.c | 6 ++++++
> >> 1 file changed, 6 insertions(+)
> >>
> >> diff --git a/drivers/char/mem.c b/drivers/char/mem.c
> >> index 84ca98ed1dad..32a932a065a6 100644
> >> --- a/drivers/char/mem.c
> >> +++ b/drivers/char/mem.c
> >> @@ -480,6 +480,11 @@ static ssize_t splice_write_null(struct pipe_inode_info *pipe, struct file *out,
> >> return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null);
> >> }
> >>
> >> +static int uring_cmd_null(struct io_uring_cmd *ioucmd, unsigned int issue_flags)
> >> +{
> >> + return 0;
> >
> > If a callback just returns 0, that implies it is not needed at all and
> > can be removed and then you are back at the original file before your
> > commit :)
>
> In theory you are correct, but the empty hook is needed so that
> submitting an io_uring cmd to the file type is attempted. If not it's
> just errored upfront.
>
> Paul, is it strictly needed to test the selinux uring cmd policy? If the
> operation would've been attempted but null doesn't support it, you'd get
> -1/EOPNOTSUPP - and supposedly you'd get EACCES/EPERM or something if
> it's filtered?
I haven't built a kernel without this patch to test, but yes, you are
probably correct that it wouldn't be strictly necessary, but
considering the extreme simplicity of this addition, what is the real
harm here? Wouldn't it be nice to have a rather simple
IORING_OP_URING_CMD target?
Also, just so we are clear, I didn't mark this patch with the
stable/fixes tags because I don't believe this should go into -stable;
while I believe it is a nice addition, it is definitely not critical.
--
paul-moore.com
next prev parent reply other threads:[~2022-08-23 18:39 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 21:21 [PATCH 0/3] LSM hooks for IORING_OP_URING_CMD Paul Moore
2022-08-22 21:21 ` [PATCH 1/3] lsm,io_uring: add LSM hooks for the new uring_cmd file op Paul Moore
2022-08-23 6:53 ` Greg Kroah-Hartman
2022-08-23 16:48 ` Paul Moore
2022-08-24 6:12 ` Greg Kroah-Hartman
2022-08-24 14:00 ` Paul Moore
2022-08-22 21:21 ` [PATCH 2/3] selinux: implement the security_uring_cmd() LSM hook Paul Moore
2022-08-23 6:52 ` Greg Kroah-Hartman
2022-08-23 16:49 ` Paul Moore
[not found] ` <CGME20220901201553eucas1p258ee1cba97c888aab172d31d9c06e922@eucas1p2.samsung.com>
2022-09-01 20:15 ` Joel Granados
2022-09-01 21:30 ` Paul Moore
2022-09-07 8:17 ` Joel Granados
2022-09-16 12:59 ` Joel Granados
2022-08-22 21:21 ` [PATCH 3/3] /dev/null: add IORING_OP_URING_CMD support Paul Moore
2022-08-22 22:36 ` Jens Axboe
2022-08-22 23:09 ` Paul Moore
2022-08-22 23:13 ` Jens Axboe
2022-08-22 23:19 ` Paul Moore
2022-08-22 23:25 ` Jens Axboe
2022-08-22 23:37 ` Paul Moore
2022-08-23 6:51 ` Greg Kroah-Hartman
2022-08-23 13:33 ` Jens Axboe
2022-08-23 17:02 ` Paul Moore [this message]
2022-08-23 6:52 ` Greg Kroah-Hartman
2022-08-23 17:02 ` Paul Moore
2022-08-24 6:10 ` Greg Kroah-Hartman
2022-08-24 14:06 ` Paul Moore
2022-08-26 16:27 ` [PATCH 0/3] LSM hooks for IORING_OP_URING_CMD Paul Moore
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=CAHC9VhRiTDqL-EtUcJ9y8nzRPk2BAfGzWK97oe56Ld4KyZsmGg@mail.gmail.com \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox