Commit 8194a008 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'audit-pr-20220518' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit

Pull audit fix from Paul Moore:
 "A single audit patch to fix a problem where a task's audit_context was
  not being properly reset with io_uring"

* tag 'audit-pr-20220518' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit:
  audit,io_uring,io-wq: call __audit_uring_exit for dummy contexts
parents 6899c161 69e9cd66
...@@ -339,7 +339,7 @@ static inline void audit_uring_entry(u8 op) ...@@ -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) ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment