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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090506161116.GA5997@nowhere>
Date:	Wed, 6 May 2009 18:11:19 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Li Zefan <lizf@...fujitsu.com>, Yinghai Lu <yinghai@...nel.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Jeremy Fitzhardinge <jeremy@...p.org>,
	Zhaolei <zhaolei@...fujitsu.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Vegard Nossum <vegard.nossum@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: printk %0*X is broken.

On Wed, May 06, 2009 at 04:30:21PM +0800, Li Zefan wrote:
> Ingo Molnar wrote:
> > Cc:-ed more folks who modified lib/vsprintf.c recently.
> > 
> > 	Ingo
> > 
> > * Yinghai Lu <yinghai@...nel.org> wrote:
> > 
> >> it seems someone broke 
> >>
> >> printk(   "%0*X\n", width, x);
> >>
> >> looks like 0 is dumped.
> >>
> >> YH
> >>
> >> [    0.000000] MTRR variable ranges enabled:
> >> [    0.000000]   0 base 0   00000000 mask FF0 00000000 write-back
> >> [    0.000000]   1 base 10  00000000 mask FFF 80000000 write-back
> >> [    0.000000]   2 base 0   80000000 mask FFF 80000000 uncachable
> >> [    0.000000]   3 base 0   7F800000 mask FFF FF800000 uncachable
> >>
> 
> 2.6.30-rc4-tip, the output of my box:
> 
> high_width: 1
> MTRR variable ranges enabled:
>   0 base 000000000 mask FC0000000 write-back
>   1 base 03C000000 mask FFC000000 uncachable
>   2 base 0D0000000 mask FF8000000 write-combining
> 
> Is it possible that high_width is negative in your output?
> If high_width == -3, we can get exactly the same output with yours.


Indeed, a negative value given as the width will actually pad to the
right (reverse width forcing).
If you have -3, that matches the normal printf behaviour.

Yinghai, could you check please if that's the case for you? 

Thanks,

Frederic.

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