Closed cgzones closed 2 years ago
Thanks @cgzones, is this something you want to try fixing?
Testing
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index f3a2abd6d1a1..a21a38a3debf 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1014,8 +1014,8 @@ static void audit_reset_context(struct audit_context *ctx)
ctx->target_comm[0] = '\0';
unroll_tree_refs(ctx, NULL, 0);
WARN_ON(!list_empty(&ctx->killed_trees));
- ctx->type = 0;
audit_free_module(ctx);
+ ctx->type = 0; /* reset after audit_free_module() */
ctx->fds[0] = -1;
audit_proctitle_free(ctx);
}
That looks like the culprit :)
The only suggestion I might have would be to move the ctx->type = 0;
line to the bottom of the function, after the call to audit_proctitle_free(ctx);
just in case something like this happens with other portions of the audit_context
.
Thanks!
Version: 5.19.0-rc2
Similar to https://github.com/linux-audit/audit-kernel/commit/95e0b46fcebd7dbf6850dee96046e4c4ddc7f69c: