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

2016-04-26 Thread Peter Zijlstra
On Mon, Apr 25, 2016 at 12:54:37PM -0700, Greg Kroah-Hartman wrote: > On Mon, Apr 25, 2016 at 09:24:35PM +0200, Peter Zijlstra wrote: > > On Mon, Apr 25, 2016 at 12:18:15PM -0700, Greg Kroah-Hartman wrote: > > > On Mon, Apr 25, 2016 at 09:06:51PM +0200, Peter Zijlstra wrote: > > > > On Mon, Apr 25,

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

2016-04-26 Thread Peter Zijlstra
On Tue, Apr 26, 2016 at 12:43:49PM +0200, Bjørn Mork wrote: > Ingo Molnar writes: > > > static int parse_proc_cmdline_item(const char *key, const char *value) { > > > > /* > > * The systemd.log_xyz= settings are parsed by all tools, and > > * so is "debug". > >

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

2016-04-26 Thread Borislav Petkov
On Mon, Apr 25, 2016 at 01:23:36PM -0700, Linus Torvalds wrote: > I really don't think this should be about open/close, but about rate > limiting writes. FWIW, I've taken your ratelimiting change into SLES at the time the whole "fun" happened and we haven't had any complaints with it so far: http

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

2016-04-26 Thread Bjørn Mork
Ingo Molnar writes: > static int parse_proc_cmdline_item(const char *key, const char *value) { > > /* > * The systemd.log_xyz= settings are parsed by all tools, and > * so is "debug". > * > * However, "quiet" is only parsed by PID 1, and only turns of

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

2016-04-25 Thread Ingo Molnar
* Steven Rostedt wrote: > On Mon, 25 Apr 2016 12:28:30 -0700 > Linus Torvalds wrote: > > > On Mon, Apr 25, 2016 at 12:06 PM, Peter Zijlstra > > wrote: > > > > I think it should be a tristate with "yes/no/ratelimit", and let's > > default to ratelimit. > > > > Also note that ratelimit woul

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

2016-04-25 Thread Steven Rostedt
On Mon, 25 Apr 2016 13:45:25 -0700 Linus Torvalds wrote: > On Mon, Apr 25, 2016 at 1:34 PM, Steven Rostedt wrote: > > > > There's a bug somewhere with mine: > > > > # journalctl -k > > No journal files were found. > > -- No entries -- > > Is that with your patch? If you don't allow kmsg open,

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

2016-04-25 Thread Linus Torvalds
On Mon, Apr 25, 2016 at 1:34 PM, Steven Rostedt wrote: > > There's a bug somewhere with mine: > > # journalctl -k > No journal files were found. > -- No entries -- Is that with your patch? If you don't allow kmsg open, maybe systemd doesn't end up logging for reads either? That said, the worst p

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

2016-04-25 Thread Steven Rostedt
On Mon, 25 Apr 2016 13:23:36 -0700 Linus Torvalds wrote: > But the other issue is that once you actually have logging working, I > don't see why you don't just look at the system logs. Yeah, it's not > /var/log/messages any more, but it's not *that* hard to do. Just use > "journalctl -k" instea

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

2016-04-25 Thread Linus Torvalds
On Mon, Apr 25, 2016 at 1:00 PM, Steven Rostedt wrote: > > For the purpose to pass messages from early init through to final boot. > Systemd continued this for the same purpose. Which I agree is totally > legit. But where systemd fails, is that it continues to use this > interface far beyond the n

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

2016-04-25 Thread Steven Rostedt
On Mon, 25 Apr 2016 12:54:37 -0700 Greg Kroah-Hartman wrote: > > This systemd exposure has seriously eroded your sanity. > > See Andrew's message, this was added because of klibc :) For the purpose to pass messages from early init through to final boot. Systemd continued this for the same pu

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

2016-04-25 Thread Greg Kroah-Hartman
On Mon, Apr 25, 2016 at 09:24:35PM +0200, Peter Zijlstra wrote: > On Mon, Apr 25, 2016 at 12:18:15PM -0700, Greg Kroah-Hartman wrote: > > On Mon, Apr 25, 2016 at 09:06:51PM +0200, Peter Zijlstra wrote: > > > On Mon, Apr 25, 2016 at 02:56:06PM -0400, Steven Rostedt wrote: > > > > +static bool __read

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

2016-04-25 Thread Andi Kleen
Steven Rostedt writes: > Over the weekend my server was acting funny. The display wasn't working > well, and I assumed that a driver was going bad. I went to look at the > kernel dmesg, but the buffer only had the following over and over: You may also like https://lkml.org/lkml/2016/4/9/70 Oth

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

2016-04-25 Thread Andrew Morton
On Mon, 25 Apr 2016 21:24:35 +0200 Peter Zijlstra wrote: > On Mon, Apr 25, 2016 at 12:18:15PM -0700, Greg Kroah-Hartman wrote: > > On Mon, Apr 25, 2016 at 09:06:51PM +0200, Peter Zijlstra wrote: > > > On Mon, Apr 25, 2016 at 02:56:06PM -0400, Steven Rostedt wrote: > > > > +static bool __read_most

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

2016-04-25 Thread Steven Rostedt
On Mon, 25 Apr 2016 12:28:30 -0700 Linus Torvalds wrote: > On Mon, Apr 25, 2016 at 12:06 PM, Peter Zijlstra wrote: > > I think it should be a tristate with "yes/no/ratelimit", and let's > default to ratelimit. > Also note that ratelimit wouldn't have solved my issue either. It wasn't that sys

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

2016-04-25 Thread Steven Rostedt
On Mon, 25 Apr 2016 12:28:30 -0700 Linus Torvalds wrote: > On Mon, Apr 25, 2016 at 12:06 PM, Peter Zijlstra 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/

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

2016-04-25 Thread Linus Torvalds
On Mon, Apr 25, 2016 at 12:28 PM, Linus Torvalds wrote: > > I think it should be a tristate with "yes/no/ratelimit", and let's > default to ratelimit. Oh, and in general we should *not* use "negative" settings. It's really annoying to have to enable things with a double negative. So even if you

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

2016-04-25 Thread Steven Rostedt
On Mon, 25 Apr 2016 12:18:15 -0700 Greg Kroah-Hartman wrote: > On Mon, Apr 25, 2016 at 09:06:51PM +0200, Peter Zijlstra wrote: > > On Mon, Apr 25, 2016 at 02:56:06PM -0400, Steven Rostedt wrote: > > > +static bool __read_mostly devkmsg_disabled; > > > +static int __init disable_devkmsg(char *st

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

2016-04-25 Thread Linus Torvalds
On Mon, Apr 25, 2016 at 12:06 PM, Peter Zijlstra 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 w

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

2016-04-25 Thread Peter Zijlstra
On Mon, Apr 25, 2016 at 12:18:15PM -0700, Greg Kroah-Hartman wrote: > On Mon, Apr 25, 2016 at 09:06:51PM +0200, Peter Zijlstra wrote: > > On Mon, Apr 25, 2016 at 02:56:06PM -0400, Steven Rostedt wrote: > > > +static bool __read_mostly devkmsg_disabled; > > > +static int __init disable_devkmsg(char

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

2016-04-25 Thread Greg Kroah-Hartman
On Mon, Apr 25, 2016 at 09:06:51PM +0200, Peter Zijlstra wrote: > On Mon, Apr 25, 2016 at 02:56:06PM -0400, Steven Rostedt wrote: > > +static bool __read_mostly devkmsg_disabled; > > +static int __init disable_devkmsg(char *str) > > +{ > > + devkmsg_disabled = true; > > + return 0; > > +} > > +

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

2016-04-25 Thread Peter Zijlstra
On Mon, Apr 25, 2016 at 02:56:06PM -0400, Steven Rostedt wrote: > +static bool __read_mostly devkmsg_disabled; > +static int __init disable_devkmsg(char *str) > +{ > + devkmsg_disabled = true; > + return 0; > +} > +__setup("printk.disable_kmsg_write", disable_devkmsg); Again, please defaul

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

2016-04-25 Thread Steven Rostedt
Over the weekend my server was acting funny. The display wasn't working well, and I assumed that a driver was going bad. I went to look at the kernel dmesg, but the buffer only had the following over and over: [226062.401405] systemd-logind[3511]: Removed session 4168. [226063.381051] systemd-logi