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] [day] [month] [year] [list]
Date:	Tue, 2 Feb 2010 11:50:02 +1100
From:	Anton Blanchard <anton@...ba.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] panic: Fix panic_timeout accuracy when running on a
 hypervisor


Hi Andrew,

> > +static void panic_blink_one_second(void)
> > +{
> > +	static long i = 0, end;
> 
> I assumed the `static' was a brainfart and removed it?

...

> In fact we can simplify it a bit:
> 
> --- a/kernel/panic.c~panic-fix-panic_timeout-accuracy-when-running-on-a-hypervisor-fix
> +++ a/kernel/panic.c
> @@ -42,12 +42,10 @@ EXPORT_SYMBOL(panic_blink);
>  
>  static void panic_blink_one_second(void)
>  {
> -	static long i = 0, end;
> -
>  	if (panic_blink) {
> -		end = i + MSEC_PER_SEC;
> +		long i = 0;
>  
> -		while (i < end) {
> +		while (i < MSEC_PER_SEC) {
>  			i += panic_blink(i);
>  			mdelay(1);
>  			i++;

Unfortunately the panic_blink users seem to rely on count ever increasing:

static long i8042_panic_blink(long count)
{
...
        static long last_blink;
...
        if (count - last_blink < i8042_blink_frequency)
                return 0;

If we reset to 0 each second, this is going to always be true. Ugly interface.

Anton
--
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