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]
Message-ID: <871vd7oc38.fsf@devron.myhome.or.jp>
Date:	Thu, 20 May 2010 05:44:59 +0900
From:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-kernel@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH] Fix uninitialized spinlock of printk_ratelimited()

Andrew Morton <akpm@...ux-foundation.org> writes:

>>  #ifdef CONFIG_PRINTK
>> -#define printk_ratelimited(fmt, ...)  ({		\
>> -	static struct ratelimit_state _rs = {		\
>> -		.interval = DEFAULT_RATELIMIT_INTERVAL, \
>> -		.burst = DEFAULT_RATELIMIT_BURST,       \
>> -	};                                              \
>> -							\
>> -	if (__ratelimit(&_rs))                          \
>> -		printk(fmt, ##__VA_ARGS__);		\
>> +#define printk_ratelimited(fmt, ...)  ({				\
>> +	static DEFINE_RATELIMIT_STATE(_rs,				\
>> +				      DEFAULT_RATELIMIT_INTERVAL,	\
>> +				      DEFAULT_RATELIMIT_BURST);		\
>> +									\
>> +	if (__ratelimit(&_rs))						\
>> +		printk(fmt, ##__VA_ARGS__);				\
>>  })
>
> hm, yes, that spinlock will get the all-zeroes pattern.
>
> It's been like this since December 2009.  I'm a bit surprised that none
> of our spinlock-debugging goodies picked this up.  All the
> CONFIG_DEBUG_SPINLOCK spinlock fields end up zeroed out also.

The reason that dynamic analysis didn't pick up is simple - nobody is
using this for now :)

Thanks.
-- 
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
--
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