audit: free audit_proctitle only on task exit
authorRichard Guy Briggs <rgb@redhat.com>
Thu, 25 Aug 2022 19:32:39 +0000 (15:32 -0400)
committerPaul Moore <paul@paul-moore.com>
Fri, 26 Aug 2022 21:18:54 +0000 (17:18 -0400)
commitc3f3ea8af44d0c5fba79fe8b198087342d0c7e04
tree26d38decb0f81c03a46a726f89f54334f3de7379
parent3ed66951f952ed8f1a5d03e171722bf2631e8d58
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: 12c5e81d3fd0 ("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>
kernel/auditsc.c