Skip to content

Commit c3f3ea8

Browse files
rgbriggspcmoore
authored andcommitted
audit: free audit_proctitle only on task exit
Since audit_proctitle is generated at syscall exit time, its value is used immediately and cached for the next syscall. Since this is the case, then only clear it at task exit time. Otherwise, there is no point in caching the value OR bearing the overhead of regenerating it. Fixes: 12c5e81 ("audit: prepare audit_context for use in calling contexts beyond syscalls") Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent 3ed6695 commit c3f3ea8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/auditsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,6 @@ static void audit_reset_context(struct audit_context *ctx)
10161016
WARN_ON(!list_empty(&ctx->killed_trees));
10171017
audit_free_module(ctx);
10181018
ctx->fds[0] = -1;
1019-
audit_proctitle_free(ctx);
10201019
ctx->type = 0; /* reset last for audit_free_*() */
10211020
}
10221021

@@ -1077,6 +1076,7 @@ static inline void audit_free_context(struct audit_context *context)
10771076
{
10781077
/* resetting is extra work, but it is likely just noise */
10791078
audit_reset_context(context);
1079+
audit_proctitle_free(context);
10801080
free_tree_refs(context);
10811081
kfree(context->filterkey);
10821082
kfree(context);

0 commit comments

Comments
 (0)