Skip to content
  • Jan Kiszka's avatar
    printk: don't prefer unsuited consoles on registration · cd3a1b85
    Jan Kiszka authored
    
    
    console election: If some console happens to be registered first which does
    not provide a tty binding (!console->device), it prevents that more suited
    consoles which are registered later on can enter the candidate pool for
    console_device().  This is observable with KGDB's console which may already
    be registered (and exploited!) during early debugger connections, that is
    before any regular console registration.
    
    This patch fixes the issue by postponing the final, automated
    preferred_console selection until someone with a non-NULL device handler
    comes around.
    
    Signed-off-by: default avatarJan Kiszka <jan.kiszka@web.de>
    Cc: Jason Wessel <jason.wessel@windriver.com>
    Cc: Gerd Hoffmann <kraxel@suse.de>
    Cc: Michael Ellerman <michael@ellerman.id.au>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    cd3a1b85