Re: [PATCH v2] printk: Add kernel parameter to disable writes to /dev/kmsg

From: Linus Torvalds
Date: Mon Apr 25 2016 - 15:28:35 EST


On Mon, Apr 25, 2016 at 12:06 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> Again, please default enable and use an easier name to toggle this.
> Userspace flooding this with junk is really insane.

I think it should be a tristate with "yes/no/ratelimit", and let's
default to ratelimit.

And I also suspect that we would be better off not returning an error
(which could make user space decide to break, either intentionally or
just because some people think that "error handling is important"
means that you should abort on all errors you don't recognize), but
just silently drop the write. IOW, the "no" would just be a rather
extreme form of rate-limiting, while "yes" would just be the other
extreme.

Linus