lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090506073456.GC17457@elte.hu>
Date:	Wed, 6 May 2009 09:34:56 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Jason Wessel <jason.wessel@...driver.com>
Cc:	greg@...ah.com, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] usb,early_printk: unregister early usb before
	rest_init()


* Jason Wessel <jason.wessel@...driver.com> wrote:

> The early_printk EHCI debug driver can hang the system or cause
> unpredictable results because two separate APIs will attempt to write
> to the mapped PCI region.
> 
> The safe route is to unregister the early USB console at the end of
> the core kernel init, which is before the PCI initialization.  Later,
> after the USB initialization completes it is then possible to register
> the console against the usb debug device and receive the printk
> messages that were missed in the period between early printk
> availability and the USB console device.
> 
> Signed-off-by: Jason Wessel <jason.wessel@...driver.com>
> ---
>  arch/x86/kernel/early_printk.c |   22 ++++++++++++++++++++++
>  1 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
> index e38c467..ef177d4 100644
> --- a/arch/x86/kernel/early_printk.c
> +++ b/arch/x86/kernel/early_printk.c
> @@ -952,4 +952,26 @@ static int __init setup_early_printk(char *buf)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_EARLY_PRINTK_DBGP
> +/*
> + * The early console must get unregistered prior to the ECHI
> + * controller getting reset else the debug device cannot be used until
> + * a subsequent EHCI reset, or the kernel hangs.
> + */
> +static int __init usb_early_debug_cleanup(void)
> +{
> +	if (early_dbgp_console.index >= 0 &&
> +		early_dbgp_console.flags & CON_PRINTBUFFER) {
> +		console_stop(early_console);
> +		unregister_console(early_console);
> +		early_dbgp_console.index = -1;
> +		early_dbgp_console.flags = 0;
> +		ehci_debug = NULL;
> +		printk(KERN_INFO "Early USB console unregistered\n");
> +	}
> +	return 0;
> +}
> +postcore_initcall(usb_early_debug_cleanup);
> +#endif /* CONFIG_EARLY_PRINTK_DBGP */

We already have CON_BOOT which allows the unregistering of early 
consoles, via disable_boot_consoles() initcall in kernel/printk.c.

The hang should be solved differently: either by calling 
disable_boot_consoles() explicitly after console_init() - or by 
introducing another CON_ flag that marks the console for early 
forced unregistering.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ