coredump: Standartize and fix logging
authorRoman Kisel <romank@linux.microsoft.com>
Thu, 18 Jul 2024 18:27:24 +0000 (11:27 -0700)
committerKees Cook <kees@kernel.org>
Tue, 6 Aug 2024 04:29:20 +0000 (21:29 -0700)
commitc114e9948c2b6a0b400266e59cc656b59e795bca
tree791b33c3f1d316e21358e3ae5820e50aa5c50dec
parentde9c2c66ad8e787abec7c9d7eff4f8c3cdd28aed
coredump: Standartize and fix logging

The coredump code does not log the process ID and the comm
consistently, logs unescaped comm when it does log it, and
does not always use the ratelimited logging. That makes it
harder to analyze logs and puts the system at the risk of
spamming the system log incase something crashes many times
over and over again.

Fix that by logging TGID and comm (escaped) consistently and
using the ratelimited logging always.

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Tested-by: Allen Pais <apais@linux.microsoft.com>
Link: https://lore.kernel.org/r/20240718182743.1959160-2-romank@linux.microsoft.com
Signed-off-by: Kees Cook <kees@kernel.org>
fs/coredump.c
include/linux/coredump.h