Linux-audit Archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Julian Orth <ju.orth@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-audit@redhat.com, linux-kernel@vger.kernel.org,
	Eric Paris <eparis@redhat.com>
Subject: Re: [PATCH 1/1] audit,io_uring,io-wq: call __audit_uring_exit for dummy contexts
Date: Tue, 17 May 2022 17:34:01 -0400	[thread overview]
Message-ID: <CAHC9VhT9ZEM03CYq9eJu-V-Ei0qFWV7XTC4EUU8fV274JK=WDQ@mail.gmail.com> (raw)
In-Reply-To: <CAHC9VhR_N+N1=3vbbmym36aDA+sUY2c4yRJq74K+=Fr27TBLQw@mail.gmail.com>

On Tue, May 17, 2022 at 9:12 AM Paul Moore <paul@paul-moore.com> wrote:
> On Tue, May 17, 2022 at 6:33 AM Julian Orth <ju.orth@gmail.com> wrote:
> >
> > Not calling the function for dummy contexts will cause the context to
> > not be reset. During the next syscall, this will cause an error in
> > __audit_syscall_entry:
> >
> >         WARN_ON(context->context != AUDIT_CTX_UNUSED);
> >         WARN_ON(context->name_count);
> >         if (context->context != AUDIT_CTX_UNUSED || context->name_count) {
> >                 audit_panic("unrecoverable error in audit_syscall_entry()");
> >                 return;
> >         }
> >
> > These problematic dummy contexts are created via the following call
> > chain:
> >
> >        exit_to_user_mode_prepare
> >     -> arch_do_signal_or_restart
> >     -> get_signal
> >     -> task_work_run
> >     -> tctx_task_work
> >     -> io_req_task_submit
> >     -> io_issue_sqe
> >     -> audit_uring_entry
> >
> > Fixes: 5bd2182d58e9 ("audit,io_uring,io-wq: add some basic audit support to io_uring")
> > Signed-off-by: Julian Orth <ju.orth@gmail.com>
> > ---
> >  include/linux/audit.h | 2 +-
> >  kernel/auditsc.c      | 6 ++++++
> >  2 files changed, 7 insertions(+), 1 deletion(-)
>
> Hi Julian,
>
> Thanks for the report and the patch too!  I agree that it does seem a
> little odd that we haven't seen this before, let me dig into this a
> bit more today and respond back.

The patch looks good to me, thanks again.  I just merged this into the
audit/stable-5.18 branch and added a stable tag; assuming the test
runs go okay I'll send this up to Linus tomorrow.

-- 
paul-moore.com

--
Linux-audit mailing list
Linux-audit@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-audit


      reply	other threads:[~2022-05-17 21:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 10:32 [PATCH 0/1] audit, io_uring, io-wq: call __audit_uring_exit for dummy contexts Julian Orth
2022-05-17 10:32 ` [PATCH 1/1] " Julian Orth
2022-05-17 13:12   ` [PATCH 1/1] audit,io_uring,io-wq: " Paul Moore
2022-05-17 21:34     ` Paul Moore [this message]

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='CAHC9VhT9ZEM03CYq9eJu-V-Ei0qFWV7XTC4EUU8fV274JK=WDQ@mail.gmail.com' \
    --to=paul@paul-moore.com \
    --cc=axboe@kernel.dk \
    --cc=eparis@redhat.com \
    --cc=ju.orth@gmail.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).