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:	Fri, 31 May 2013 09:54:52 -0700
From:	Joe Perches <joe@...ches.com>
To:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc:	Davidlohr Bueso <davidlohr.bueso@...com>,
	Bjørn Mork <bjorn@...k.no>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>, netdev@...r.kernel.org,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: skbuff: use _RET_IP_

On Fri, 2013-05-31 at 18:33 +0400, Sergei Shtylyov wrote:
> On 31-05-2013 9:20, Joe Perches wrote:
> > Don't use a standalone gcc compiled program to
> > determine what the kernel outputs.
[]
> > The kernel output is;
> 
> > 	printk("0x%lx\n", 0x100ul)		0x100
> > 	printk("%p\n", (void *)0x100ul)		00000100
> > 	printk("%#p\n", (void *)0x100ul)	0x00000100
> 
> > The last one isn't used at all in kernel source. (gcc complains)
> > It's always "0x%p"
> 
>      I was talking about using "%#lx", not "%#p". I don't see it in your 
> example.

"0x%lx" and "%#lx" produce the same output in the kernel.

The latter isn't used very often though.
I expect most coders don't know it exists/works.

$ git grep -E "0x%l{0,2}x" | wc -l
12542
$ git grep -E "%#l{0,2}x" | wc -l
1737

(some false positives there of course)

Also, some might expect that "%#08lx", is 10 chars wide,
but it's only 8, so maybe "0x%08lx" is better used.

The "%#08lx" width defect seems pretty common:

$ git grep -E -i "%#0(8|16)l{0,2}x" | wc -l
253


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ