To avoid dmesg flooding, use pr_warn_once instead of pr_warn.
Signed-off-by: Kees Cook <keescook@chromium.org>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
static void warn_sysctl_write(struct ctl_table *table)
{
- pr_warn("write to %s by %s used a non-zero file position!\n",
- table->procname, current->comm);
- pr_warn("This will not be supported in the future.\n");
- pr_warn("To silence warning, set kernel.sysctl_writes_strict = -1\n");
+ pr_warn_once("%s wrote to %s when file position was not 0!\n"
+ "This will not be supported in the future. To silence this\n"
+ "warning, set kernel.sysctl_writes_strict = -1\n",
+ current->comm, table->procname);
}
/**