Re: printk: Add kernel parameter to disable writes to /dev/kmsg

From: Austin S. Hemmelgarn
Date: Wed Apr 27 2016 - 07:26:18 EST


On 2016-04-26 15:47, Steven Rostedt wrote:
On Tue, 26 Apr 2016 20:44:58 +0200
Pavel Machek <pavel@xxxxxx> wrote:

I simply propose a way to let us kernel developers keep user space from
interfering, by adding a new kernel command line parameter that will
disable writing to /dev/kmsg. Any attempt to open the file in write
mode will return a -EPERM error.

chmod 400 /dev/kmsg? With udev, it should be possible to make it persistent...

But this opened while initramdisk is used. I'm thinking this wont work,
or does udev run before main root is mounted?

It does, but I don't think it runs before journald on systemd systems...

So it probably still wouldn't work.