lkml.org 
[lkml]   [2020]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] printk: handle blank console arguments passed in.
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.
> > */
> > preferred_console = MAX_CMDLINECONSOLES;
[..]
> Hint: I can crash my laptop when I remove the "console=" boot param and
> comment out init_dup(file) calls in console_on_rootfs().

My guess is that since we don't have stdin/out/err fds then,
theoretically, something like this can happen

int main()
{
...
int fd = open(.... );
int fd = open(..., "vfat.ko");

//fd is 1

fprintf(stdout, "loading vfat\n");
...
}

stdout (fd 1) is not stdout, it's fd that we got from open(vfat.ko).

Does this make sense?

-ss

\
 
 \ /
  Last update: 2020-10-07 16:40    [W:0.117 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site