summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-06-17 00:53:38 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2022-06-17 00:53:38 +0200
commit0639b599f6f3cc871a9e024481a25a7d85946eb8 (patch)
treebceebfdbb3ed925bf2153ae70530330e8d577015 /kernel
parentMerge tag 'selinux-pr-20220616' of git://git.kernel.org/pub/scm/linux/kernel/... (diff)
parentaudit: free module name (diff)
downloadlinux-0639b599f6f3cc871a9e024481a25a7d85946eb8.tar.xz
linux-0639b599f6f3cc871a9e024481a25a7d85946eb8.zip
Merge tag 'audit-pr-20220616' 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 we were not properly freeing memory allocated when recording information related to a module load" * tag 'audit-pr-20220616' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: free module name
Diffstat (limited to 'kernel')
-rw-r--r--kernel/auditsc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index f3a2abd6d1a1..3a8c9d744800 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1014,10 +1014,10 @@ 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->fds[0] = -1;
audit_proctitle_free(ctx);
+ ctx->type = 0; /* reset last for audit_free_*() */
}
static inline struct audit_context *audit_alloc_context(enum audit_state state)