]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:57:06 +0000 (09:57 +0200)
commitd3c1fb19ca1ec2e7b6c26549f4fe4c3707be13bf
tree8937ac675b5cbceb0b17336ba7f37af0d4d77c57
parent44fe6d9a0d8d4554cd450baf754e4e6eb6b44e65
audit: free audit_proctitle only on task exit

[ Upstream commit c3f3ea8af44d0c5fba79fe8b198087342d0c7e04 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/auditsc.c