]> git.baikalelectronics.ru Git - kernel.git/commit
audit,io_uring,io-wq: call __audit_uring_exit for dummy contexts
authorJulian Orth <ju.orth@gmail.com>
Tue, 17 May 2022 10:32:53 +0000 (12:32 +0200)
committerPaul Moore <paul@paul-moore.com>
Tue, 17 May 2022 19:03:36 +0000 (15:03 -0400)
commit13411bcdd274b81a1ed1f43e30dc1d52a860d388
tree72296aa53c30b631a5d99898780a84ad1d0baf5c
parent06e6170e0ae33ea1ff98f01501371e23c4eee66a
audit,io_uring,io-wq: call __audit_uring_exit for dummy contexts

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: 570c522a6b5d ("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>
include/linux/audit.h
kernel/auditsc.c