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:	Thu, 14 Feb 2008 09:11:04 +0900
From:	Tejun Heo <htejun@...il.com>
To:	Ingo Molnar <mingo@...e.hu>
CC:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Randy Dunlap <randy.dunlap@...cle.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH REPOST] printk: fix possible printk buffer overrun	introduced
 with recursion check

Hello, Ingo.

Ingo Molnar wrote:
> but i'm not sure i agree with the moving of these variables inside 
> vprintk:
> 
>> -/* cpu currently holding logbuf_lock */
>> -static volatile unsigned int printk_cpu = UINT_MAX;
>> -
>> -const char printk_recursion_bug_msg [] =
>> -			KERN_CRIT "BUG: recent printk recursion!\n";
>> -static int printk_recursion_bug;
>> -
>>  asmlinkage int vprintk(const char *fmt, va_list args)
>>  {
>> +	/* cpu currently holding logbuf_lock */
>> +	static volatile unsigned int printk_cpu = UINT_MAX;
>> +	static const char printk_recursion_bug_msg [] =
>> +		KERN_CRIT "BUG: recent printk recursion!\n";
>> +	static int printk_recursion_bug;
>>  	static int log_level_unknown = 1;
>>  	static char printk_buf[1024];
> 
> it's easy to miss a static variable inside a function local variables 

I find that difficult to agree.  As long as static ones are put above
all local ones, they are visually distinctive enough.  static variables
used by a single function are usually declared in the function all
through the source tree.

> block. It would b ebetter to move log_level_unknown and printk_buf 
> _outside_ the function, to the other ones. [and to mark 
> printk_recursion_bug_msg static]

Well, I thought it was an obvious clean up.  Time to split this patch
up, I guess.

Thanks.

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