Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 6 Dec 2017 15:21:58 -0800
From: Kees Cook <keescook@...omium.org>
To: David Laight <David.Laight@...lab.com>
Cc: David Miller <davem@...emloft.net>, "geert@...ux-m68k.org" <geert@...ux-m68k.org>, 
	"me@...in.cc" <me@...in.cc>, 
	"kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com>, 
	"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>, "Jason@...c4.com" <Jason@...c4.com>, 
	"tytso@....edu" <tytso@....edu>, "pbonzini@...hat.com" <pbonzini@...hat.com>, "tycho@...ho.ws" <tycho@...ho.ws>, 
	"william.c.roberts@...el.com" <william.c.roberts@...el.com>, "tj@...nel.org" <tj@...nel.org>, 
	"Golden_Miller83@...tonmail.ch" <Golden_Miller83@...tonmail.ch>, 
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>, "pmladek@...e.com" <pmladek@...e.com>, 
	"joe@...ches.com" <joe@...ches.com>, "ijc@...lion.org.uk" <ijc@...lion.org.uk>, 
	"sergey.senozhatsky@...il.com" <sergey.senozhatsky@...il.com>, 
	"catalin.marinas@....com" <catalin.marinas@....com>, "wilal.deacon@....com" <wilal.deacon@....com>, 
	"rostedt@...dmis.org" <rostedt@...dmis.org>, "cfries@...gle.com" <cfries@...gle.com>, 
	"olorin@...gle.com" <olorin@...gle.com>, "danielmicay@...il.com" <danielmicay@...il.com>, 
	"tixxdz@...il.com" <tixxdz@...il.com>, "rkrcmar@...hat.com" <rkrcmar@...hat.com>, 
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, 
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>, "sfr@...b.auug.org.au" <sfr@...b.auug.org.au>, 
	"aryabinin@...tuozzo.com" <aryabinin@...tuozzo.com>, "glider@...gle.com" <glider@...gle.com>, 
	"dvyukov@...gle.com" <dvyukov@...gle.com>, 
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>, 
	"sergei.shtylyov@...entembedded.com" <sergei.shtylyov@...entembedded.com>
Subject: Re: [PATCH V11 3/5] printk: hash addresses printed with %p

On Wed, Dec 6, 2017 at 2:31 AM, David Laight <David.Laight@...lab.com> wrote:
> From: David Miller
>> Sent: 05 December 2017 20:31
> ...
>> > Would it make sense to keep the 3 lowest bits of the address?
>> >
>> > Currently printed pointers no longer have any correlation with the actual
>> > alignment in memory of the object, which is a typical cause of a class of bugs.
>>
>> Yeah, this is driving people nuts who wonder why pointers are aligned
>> all weird now.
>
> I can also image issues where you want to know whether 2 pointers point
> into the same structure (like an skb).

This is already retained due to the hashing. i.e. the same pointer
value will produce the same hash value, so that kind of direct
comparison still works.

> Useful if you suspect that code is using a stale pointer because the
> skb got reallocated by some internal function.
> I'm not sure such pointers are printed by default though.

I hope not. :) skb used to be exported for INET_DIAG, but that got
fixed a while back.

-Kees

-- 
Kees Cook
Pixel Security

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.