Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-22 Thread Sergey Senozhatsky
On (20/10/22 13:38), Petr Mladek wrote: > > Hmm. How about this. console= is undocumented and unspecified - it > > may work sometimes or it may kill the system (and theoretically even > > corrupt some files, depending on what fd 1 and fd 2 point to). So > > maybe we can document console= and

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-22 Thread Petr Mladek
On Thu 2020-10-08 14:52:38, Sergey Senozhatsky wrote: > On (20/10/08 01:29), Sergey Senozhatsky wrote: > > On (20/10/07 08:57), Guenter Roeck wrote: > > > On 10/7/20 5:30 AM, Sergey Senozhatsky wrote: > > > > [..] > > > > > I can see to options: Link /dev/console to /dev/null if there is no > >

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-08 Thread Sergey Senozhatsky
On (20/10/08 21:20), Sergey Senozhatsky wrote: [..] > > > Let me dump my findings so far. I still don't understand what exactly > > > crashes the laptop (blank screen is not very helpful). > > > > > > So, things start with the "preferred_console = -1". In console_setup() > > > we call

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-08 Thread Sergey Senozhatsky
On (20/10/08 10:50), Petr Mladek wrote: > On Wed 2020-10-07 21:30:44, Sergey Senozhatsky wrote: > > On (20/10/07 09:28), Petr Mladek wrote: > > > > > > /* > > >* Dirty hack to prevent using any console with tty > > >* binding as a fallback and adding the empty >

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-08 Thread Sergey Senozhatsky
On (20/10/08 11:01), Petr Mladek wrote: > > + it is yet another way to affect the amount of messages > on console. We already have console_loglevel, ignore_loglevel. True. Yes, there are "alternative" ways of doing this, but what we have to face here is - console= has been used for a long

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-08 Thread Sergey Senozhatsky
On (20/10/08 11:01), Petr Mladek wrote: > > Interesting idea. Well, it looks like yet another mess: > > + it would show the consoles in /proc/consoles > even thought they will be basically unusable Which is fine, no? We already can have disables consoles in /proc/consoles. $ cat

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-08 Thread Petr Mladek
On Thu 2020-10-08 14:52:38, Sergey Senozhatsky wrote: > On (20/10/08 01:29), Sergey Senozhatsky wrote: > > On (20/10/07 08:57), Guenter Roeck wrote: > > > On 10/7/20 5:30 AM, Sergey Senozhatsky wrote: > > > > [..] > > > > > I can see to options: Link /dev/console to /dev/null if there is no > >

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-08 Thread Petr Mladek
On Wed 2020-10-07 21:30:44, Sergey Senozhatsky wrote: > On (20/10/07 09:28), Petr Mladek wrote: > > > > /* > > * Dirty hack to prevent using any console with tty > > * binding as a fallback and adding the empty > > * name into console_cmdline

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-07 Thread Sergey Senozhatsky
On (20/10/08 01:29), Sergey Senozhatsky wrote: > On (20/10/07 08:57), Guenter Roeck wrote: > > On 10/7/20 5:30 AM, Sergey Senozhatsky wrote: > > [..] > > > I can see to options: Link /dev/console to /dev/null if there is no console, > > or do something like > > > > if (IS_ERR(file)) { > >

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-07 Thread Sergey Senozhatsky
On (20/10/07 08:57), Guenter Roeck wrote: > On 10/7/20 5:30 AM, Sergey Senozhatsky wrote: [..] > I can see to options: Link /dev/console to /dev/null if there is no console, > or do something like > > if (IS_ERR(file)) { > pr_warn("Warning: unable to open an initial

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-07 Thread Guenter Roeck
On 10/7/20 5:30 AM, Sergey Senozhatsky wrote: [ ... ] > > console_on_rootfs() attempts to filp_open()->tty_open() /dev/console. > This ends up in printk's console_device(), which iterates the list of > console drivers and returns associated console->device back to tty. The > problem is that

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-07 Thread Sergey Senozhatsky
On (20/10/07 21:30), Sergey Senozhatsky wrote: > On (20/10/07 09:28), Petr Mladek wrote: > > > > /* > > * Dirty hack to prevent using any console with tty > > * binding as a fallback and adding the empty > > * name into console_cmdline array. > >

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-07 Thread Sergey Senozhatsky
On (20/10/07 09:28), Petr Mladek wrote: > > /* >* Dirty hack to prevent using any console with tty >* binding as a fallback and adding the empty >* name into console_cmdline array. >*/ > preferred_console

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-07 Thread Petr Mladek
On Wed 2020-10-07 02:15:04, Sergey Senozhatsky wrote: > On (20/10/06 18:35), Petr Mladek wrote: > > > > Whatever is decided, I'd like to have it made official and documented to > > > > avoid a similar problem in the future. > > > > Sigh, it is even bigger mess than I expected. There is a magic >

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Sergey Senozhatsky
On (20/10/06 18:35), Petr Mladek wrote: > > > Whatever is decided, I'd like to have it made official and documented to > > > avoid a similar problem in the future. > > Sigh, it is even bigger mess than I expected. There is a magic > variable "console_set_on_cmdline". It used, for example, in >

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Petr Mladek
On Tue 2020-10-06 15:43:28, Petr Mladek wrote: > On Tue 2020-10-06 03:45:00, Guenter Roeck wrote: > > On 10/6/20 2:52 AM, Petr Mladek wrote: > > > And it makes perfect sense to disable all consoles or drop all defined > > > by dts. But I would prefer to make it more obvious way, for > > > example

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Sergey Senozhatsky
On (20/10/06 07:22), Guenter Roeck wrote: > On 10/6/20 6:33 AM, Sergey Senozhatsky wrote: > > On (20/10/06 11:54), Petr Mladek wrote: > >> On Tue 2020-10-06 15:59:07, Sergey Senozhatsky wrote: > >>> On (20/10/05 20:35), Guenter Roeck wrote: > On a side note, I don't see the problem presumably

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Guenter Roeck
On 10/6/20 6:33 AM, Sergey Senozhatsky wrote: > On (20/10/06 11:54), Petr Mladek wrote: >> On Tue 2020-10-06 15:59:07, Sergey Senozhatsky wrote: >>> On (20/10/05 20:35), Guenter Roeck wrote: On a side note, I don't see the problem presumably fixed with this patch in any of my tests. >>>

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Petr Mladek
On Tue 2020-10-06 03:45:00, Guenter Roeck wrote: > On 10/6/20 2:52 AM, Petr Mladek wrote: > > And it makes perfect sense to disable all consoles or drop all defined > > by dts. But I would prefer to make it more obvious way, for > > example by parameters like: > > > >+ console=none > >+

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Sergey Senozhatsky
On (20/10/06 11:54), Petr Mladek wrote: > On Tue 2020-10-06 15:59:07, Sergey Senozhatsky wrote: > > On (20/10/05 20:35), Guenter Roeck wrote: > > > On a side note, I don't see the problem presumably fixed with this > > > patch in any of my tests. > > > > Hmm. This is rather interesting. Empty

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Guenter Roeck
On 10/5/20 10:08 PM, Greg Kroah-Hartman wrote: > On Mon, Oct 05, 2020 at 08:35:59PM -0700, Guenter Roeck wrote: >> On 10/5/20 7:59 PM, Sergey Senozhatsky wrote: >>> Cc-ing Guenter, >>> >>> On (20/05/22 12:00), Petr Mladek wrote: On Fri 2020-05-22 16:53:06, Shreyas Joshi wrote: > If uboot

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Guenter Roeck
On 10/6/20 2:52 AM, Petr Mladek wrote: > On Mon 2020-10-05 20:35:59, Guenter Roeck wrote: >> On 10/5/20 7:59 PM, Sergey Senozhatsky wrote: >>> On (20/05/22 12:00), Petr Mladek wrote: On Fri 2020-05-22 16:53:06, Shreyas Joshi wrote: > If uboot passes a blank string to console_setup then it

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Petr Mladek
On Tue 2020-10-06 15:59:07, Sergey Senozhatsky wrote: > On (20/10/05 20:35), Guenter Roeck wrote: > > On a side note, I don't see the problem presumably fixed with this > > patch in any of my tests. > > Hmm. This is rather interesting. Empty console= certainly oops-es my laptop, Just by chance.

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Petr Mladek
On Mon 2020-10-05 20:35:59, Guenter Roeck wrote: > On 10/5/20 7:59 PM, Sergey Senozhatsky wrote: > > On (20/05/22 12:00), Petr Mladek wrote: > >> On Fri 2020-05-22 16:53:06, Shreyas Joshi wrote: > >>> If uboot passes a blank string to console_setup then it results in a > >>> trashed memory. > >>>

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-06 Thread Sergey Senozhatsky
On (20/10/05 20:35), Guenter Roeck wrote: > On a side note, I don't see the problem presumably fixed with this > patch in any of my tests. Hmm. This is rather interesting. Empty console= certainly oops-es my laptop, but not the cros board I just tested this on. Do we carry around any chromeos

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-05 Thread Greg Kroah-Hartman
On Mon, Oct 05, 2020 at 08:35:59PM -0700, Guenter Roeck wrote: > On 10/5/20 7:59 PM, Sergey Senozhatsky wrote: > > Cc-ing Guenter, > > > > On (20/05/22 12:00), Petr Mladek wrote: > >> On Fri 2020-05-22 16:53:06, Shreyas Joshi wrote: > >>> If uboot passes a blank string to console_setup then it

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-05 Thread Guenter Roeck
On 10/5/20 7:59 PM, Sergey Senozhatsky wrote: > Cc-ing Guenter, > > On (20/05/22 12:00), Petr Mladek wrote: >> On Fri 2020-05-22 16:53:06, Shreyas Joshi wrote: >>> If uboot passes a blank string to console_setup then it results in a >>> trashed memory. >>> Ultimately, the kernel crashes during

Re: [PATCH] printk: handle blank console arguments passed in.

2020-10-05 Thread Sergey Senozhatsky
Cc-ing Guenter, On (20/05/22 12:00), Petr Mladek wrote: > On Fri 2020-05-22 16:53:06, Shreyas Joshi wrote: > > If uboot passes a blank string to console_setup then it results in a > > trashed memory. > > Ultimately, the kernel crashes during freeing up the memory. This fix > > checks if there >

Re: [PATCH] printk: handle blank console arguments passed in.

2020-05-22 Thread Petr Mladek
On Fri 2020-05-22 16:53:06, Shreyas Joshi wrote: > If uboot passes a blank string to console_setup then it results in a trashed > memory. > Ultimately, the kernel crashes during freeing up the memory. This fix checks > if there > is a blank parameter being passed to console_setup from uboot. >

[PATCH] printk: handle blank console arguments passed in.

2020-05-22 Thread Shreyas Joshi
If uboot passes a blank string to console_setup then it results in a trashed memory. Ultimately, the kernel crashes during freeing up the memory. This fix checks if there is a blank parameter being passed to console_setup from uboot. In case it detects that the console parameter is blank then it

[PATCH] printk: handle blank console arguments passed in.

2020-05-22 Thread Shreyas Joshi
If uboot passes a blank string to console_setup then it results in a trashed memory. Ultimately, the kernel crashes during freeing up the memory. This fix checks if there is a blank parameter being passed to console_setup from uboot. In case it detects that the console parameter is blank then it

[PATCH] printk: handle blank console arguments passed in.

2020-05-22 Thread Shreyas Joshi
If uboot passes a blank string to console_setup then it results in a trashed memory. Ultimately, the kernel crashes during freeing up the memory. This fix checks if there is a blank parameter being passed to console_setup from uboot. In case it detects that the console parameter is blank then it

Re: [PATCH] printk: handle blank console arguments passed in.

2020-05-20 Thread Sergey Senozhatsky
On (20/05/15 17:24), Petr Mladek wrote: [..] > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > > index ad4606234545..e9ad730991e0 100644 > > --- a/kernel/printk/printk.c > > +++ b/kernel/printk/printk.c > > @@ -2165,7 +2165,10 @@ static int __init console_setup(char *str) > >

Re: [PATCH] printk: handle blank console arguments passed in.

2020-05-15 Thread Petr Mladek
On Mon 2020-03-09 15:29:15, Shreyas Joshi wrote: > If uboot passes a blank string to console_setup then it results in a trashed > memory. > Ultimately, the kernel crashes during freeing up the memory. This fix checks > if there > is a blank parameter being passed to console_setup from uboot. >