Skip to content

Commit ef79c39

Browse files
cgzonespcmoore
authored andcommitted
audit: free module name
Reset the type of the record last as the helper `audit_free_module()` depends on it. unreferenced object 0xffff888153b707f0 (size 16): comm "modprobe", pid 1319, jiffies 4295110033 (age 1083.016s) hex dump (first 16 bytes): 62 69 6e 66 6d 74 5f 6d 69 73 63 00 6b 6b 6b a5 binfmt_misc.kkk. backtrace: [<ffffffffa07dbf9b>] kstrdup+0x2b/0x50 [<ffffffffa04b0a9d>] __audit_log_kern_module+0x4d/0xf0 [<ffffffffa03b6664>] load_module+0x9d4/0x2e10 [<ffffffffa03b8f44>] __do_sys_finit_module+0x114/0x1b0 [<ffffffffa1f47124>] do_syscall_64+0x34/0x80 [<ffffffffa200007e>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 Cc: stable@vger.kernel.org Fixes: 12c5e81 ("audit: prepare audit_context for use in calling contexts beyond syscalls") Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent b13bacc commit ef79c39

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/auditsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,10 +1014,10 @@ static void audit_reset_context(struct audit_context *ctx)
10141014
ctx->target_comm[0] = '\0';
10151015
unroll_tree_refs(ctx, NULL, 0);
10161016
WARN_ON(!list_empty(&ctx->killed_trees));
1017-
ctx->type = 0;
10181017
audit_free_module(ctx);
10191018
ctx->fds[0] = -1;
10201019
audit_proctitle_free(ctx);
1020+
ctx->type = 0; /* reset last for audit_free_*() */
10211021
}
10221022

10231023
static inline struct audit_context *audit_alloc_context(enum audit_state state)

0 commit comments

Comments
 (0)