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]
Date:	Mon, 17 Aug 2009 09:34:39 +0200
From:	Martin Schwidefsky <schwidefsky@...ibm.com>
To:	john stultz <johnstul@...ibm.com>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	Daniel Walker <dwalker@...o99.com>
Subject: Re: [patch 04/15] cleanup clocksource selection

On Fri, 14 Aug 2009 18:42:20 -0700
john stultz <johnstul@...ibm.com> wrote:

> Here when you return count, count may have been decremented in the code
> above, which causes the writer to get back fewer bytes then what they
> passed in, causing the last char to be repeatedly sent. This is what
> causes the immediate switch back to the default clocksource (override
> gets set to null), and the hang of the command writing to the sysfs
> file.
> 
> The fix is simply keeping the initial "size_t ret = count;" and the
> final "return ret;"
> 
> 
> Index: linux-2.6-tip/kernel/time/clocksource.c
> ===================================================================
> --- linux-2.6-tip.orig/kernel/time/clocksource.c	2009-08-14 17:29:50.000000000 -0400
> +++ linux-2.6-tip/kernel/time/clocksource.c	2009-08-14 17:30:36.000000000 -0400
> @@ -478,6 +478,8 @@
>  					  struct sysdev_attribute *attr,
>  					  const char *buf, size_t count)
>  {
> +	size_t ret = count;
> +
>  	/* strings from sysfs write are not 0 terminated! */
>  	if (count >= sizeof(override_name))
>  		return -EINVAL;
> @@ -495,7 +497,7 @@
> 
>  	spin_unlock_irq(&clocksource_lock);
> 
> -	return count;
> +	return ret;
>  }
> 
>  /**

Opps :-(
Thanks for bisecting & fixing.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

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