[PATCH] fs/coredump: rate limit the unsafe core_pattern warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux