Re: [RFC PATCH] cmdline: Hide "debug" from /proc/cmdline

From: Andy Lutomirski
Date: Fri Apr 04 2014 - 14:21:54 EST


On 04/03/2014 10:05 AM, Theodore Ts'o wrote:
> On Thu, Apr 03, 2014 at 12:43:08PM +0200, Joerg Roedel wrote:
>>
>> How about just ignoring writes to /dev/kmsg altogether by default
>> (unless explicitly enabled in Kconfig or on the kernel cmdline)? Maybe I
>> am missing something but what are the legitimate use-cases for generally
>> allowing user-space to write into the kernel-log?
>
> I'll give you one example which where /dev/kmesg is useful --- if you
> are running automated kernel tests, echoing "running test shared/127"
> .... several minutes later .... "running test shared/128", is very
> useful since if the kernel starts spewing warnings, or even
> oops/panics/livelocks, you know what test was running at the time of
> the failure.

I'm using /dev/kmsg in virtme so that I can easily capture, with
timestamps, the ten or so log lines that it produces. It would be sad
if I had to worry about small ratelimits here.

/dev/kmsg is genuinely useful for the case where an initramfs wants to
log something (preferably only a little bit) and doesn't want to invent
a whole protocol for passing logging data through to the final logging
system.

The other thing I've used /dev/kmsg for is to shove a "I'm starting
something now" message in. This is only really necessary because the
current kernel log timestamps are unusable crap. (We could fix that,
hint hint.)

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/