* [PATCH] fs/coredump: rate limit the unsafe core_pattern warning
@ 2022-01-19 22:27 Colin Ian King
2022-01-20 8:51 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-01-19 22:27 UTC (permalink / raw)
To: Alexander Viro, linux-fsdevel; +Cc: kernel-janitors, linux-kernel
It is possible to spam the kernel log with many invalid attempts
to set the core_pattern. Rate limit the warning message to make
it less spammy.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
fs/coredump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/coredump.c b/fs/coredump.c
index 1c060c0a2d72..2dadc1dcaa2c 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -898,7 +898,7 @@ void validate_coredump_safety(void)
{
if (suid_dumpable == SUID_DUMP_ROOT &&
core_pattern[0] != '/' && core_pattern[0] != '|') {
- pr_warn(
+ pr_warn_ratelimited(
"Unsafe core_pattern used with fs.suid_dumpable=2.\n"
"Pipe handler or fully qualified core dump path required.\n"
"Set kernel.core_pattern before fs.suid_dumpable.\n"
--
2.33.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fs/coredump: rate limit the unsafe core_pattern warning
2022-01-19 22:27 [PATCH] fs/coredump: rate limit the unsafe core_pattern warning Colin Ian King
@ 2022-01-20 8:51 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2022-01-20 8:51 UTC (permalink / raw)
To: Colin Ian King
Cc: Alexander Viro, linux-fsdevel, kernel-janitors, linux-kernel
On Wed, Jan 19, 2022 at 10:27:29PM +0000, Colin Ian King wrote:
> It is possible to spam the kernel log with many invalid attempts
> to set the core_pattern. Rate limit the warning message to make
> it less spammy.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
Acked-by: Christian Brauner <brauner@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-20 8:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 22:27 [PATCH] fs/coredump: rate limit the unsafe core_pattern warning Colin Ian King
2022-01-20 8:51 ` Christian Brauner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.