Commit 8f5de3fd authored by Guilherme G. Piccoli's avatar Guilherme G. Piccoli Committed by Kees Cook

pstore: Expose kmsg_bytes as a module parameter

Currently this tuning is only exposed as a filesystem option,
but most Linux distros automatically mount pstore, hence changing
this setting requires remounting it. Also, if that mount option
wasn't explicitly set it doesn't show up in mount information,
so users cannot check what is the current value of kmsg_bytes.

Let's then expose it as a module parameter, allowing both user
visibility at all times (even if not manually set) and also the
possibility of setting that as a boot/module parameter.
Signed-off-by: default avatarGuilherme G. Piccoli <gpiccoli@igalia.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221006224212.569555-3-gpiccoli@igalia.com
parent d85644dc
...@@ -89,6 +89,11 @@ static char *compress = ...@@ -89,6 +89,11 @@ static char *compress =
module_param(compress, charp, 0444); module_param(compress, charp, 0444);
MODULE_PARM_DESC(compress, "compression to use"); MODULE_PARM_DESC(compress, "compression to use");
/* How much of the kernel log to snapshot */
unsigned long kmsg_bytes = CONFIG_PSTORE_DEFAULT_KMSG_BYTES;
module_param(kmsg_bytes, ulong, 0444);
MODULE_PARM_DESC(kmsg_bytes, "amount of kernel log to snapshot (in bytes)");
/* Compression parameters */ /* Compression parameters */
static struct crypto_comp *tfm; static struct crypto_comp *tfm;
...@@ -100,9 +105,6 @@ struct pstore_zbackend { ...@@ -100,9 +105,6 @@ struct pstore_zbackend {
static char *big_oops_buf; static char *big_oops_buf;
static size_t big_oops_buf_sz; static size_t big_oops_buf_sz;
/* How much of the console log to snapshot */
unsigned long kmsg_bytes = CONFIG_PSTORE_DEFAULT_KMSG_BYTES;
void pstore_set_kmsg_bytes(int bytes) void pstore_set_kmsg_bytes(int bytes)
{ {
kmsg_bytes = bytes; kmsg_bytes = bytes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment