Here's a patch that limits kernel log buffer size to 1 MB max.
Comments?
I'm inserting it here via cut-and-paste, so it might not be all clean.
Patch is to 2.5.66-PV (plain vanilla).
patch_name: logbuf-limit.patch
patch_version: 2003-04-06.20:28:43
author: Randy.Dunlap <rddunlap@osdl.org>
description: limit kernel log buffer size to 1 MB
product: Linux
product_versions: 2.5.66
diffstat: =
kernel/printk.c | 3 +++
1 files changed, 3 insertions(+)
diff -Naur ./kernel/printk.c%LBLIM ./kernel/printk.c
--- ./kernel/printk.c%LBLIM 2003-04-06 20:27:28.000000000 -0700
+++ ./kernel/printk.c 2003-04-06 20:27:53.000000000 -0700
@@ -34,6 +34,9 @@
#define LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT)
#define LOG_BUF_MASK (LOG_BUF_LEN-1)
+#if (CONFIG_LOG_BUF_SHIFT > 20)
+#error CONFIG_LOG_BUF_SHIFT is ridiculously large (more than 1 MB).
+#endif
/* printk's without a loglevel use this.. */
#define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/