mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 04:47:05 +00:00
audit,io_uring,io-wq: call __audit_uring_exit for dummy contexts
commit69e9cd66ae
upstream. 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 Cc: stable@vger.kernel.org Fixes:5bd2182d58
("audit,io_uring,io-wq: add some basic audit support to io_uring") Signed-off-by: Julian Orth <ju.orth@gmail.com> [PM: subject line tweaks] Signed-off-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ec9fd8d2ee
commit
80a1f356c3
2 changed files with 7 additions and 1 deletions
|
@ -339,7 +339,7 @@ static inline void audit_uring_entry(u8 op)
|
||||||
}
|
}
|
||||||
static inline void audit_uring_exit(int success, long code)
|
static inline void audit_uring_exit(int success, long code)
|
||||||
{
|
{
|
||||||
if (unlikely(!audit_dummy_context()))
|
if (unlikely(audit_context()))
|
||||||
__audit_uring_exit(success, code);
|
__audit_uring_exit(success, code);
|
||||||
}
|
}
|
||||||
static inline void audit_syscall_entry(int major, unsigned long a0,
|
static inline void audit_syscall_entry(int major, unsigned long a0,
|
||||||
|
|
|
@ -1959,6 +1959,12 @@ void __audit_uring_exit(int success, long code)
|
||||||
{
|
{
|
||||||
struct audit_context *ctx = audit_context();
|
struct audit_context *ctx = audit_context();
|
||||||
|
|
||||||
|
if (ctx->dummy) {
|
||||||
|
if (ctx->context != AUDIT_CTX_URING)
|
||||||
|
return;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (ctx->context == AUDIT_CTX_SYSCALL) {
|
if (ctx->context == AUDIT_CTX_SYSCALL) {
|
||||||
/*
|
/*
|
||||||
* NOTE: See the note in __audit_uring_entry() about the case
|
* NOTE: See the note in __audit_uring_entry() about the case
|
||||||
|
|
Loading…
Reference in a new issue