From: Cyrill Gorcunov <gorcunov@gmail.com>
To: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Herbert Xu <herbert@gondor.hengli.com.au>,
Tejun Heo <tj@kernel.org>,
linux-kernel@vger.kernel.org,
Pavel Emelyanov <xemul@parallels.com>,
Glauber Costa <glommer@parallels.com>,
Andi Kleen <andi@firstfloor.org>,
Matt Helsley <matthltc@us.ibm.com>,
Pekka Enberg <penberg@kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
Vasiliy Kulikov <segoon@openwall.com>,
Andrew Morton <akpm@linux-foundation.org>,
Alexey Dobriyan <adobriyan@gmail.com>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [patch 1/4] Add routine for generating an ID for kernel pointer
Date: Sat, 31 Dec 2011 00:48:36 +0400 [thread overview]
Message-ID: <20111230204836.GP4806@moon> (raw)
In-Reply-To: <4EFE1FA4.3090207@gmail.com>
On Fri, Dec 30, 2011 at 03:31:32PM -0500, KOSAKI Motohiro wrote:
> (12/30/11 2:36 AM), Cyrill Gorcunov wrote:
> >On Fri, Dec 30, 2011 at 11:23:09AM +1100, Herbert Xu wrote:
> >>On Thu, Dec 29, 2011 at 08:24:53PM +0400, Cyrill Gorcunov wrote:
> >>>
> >>>Probably I've had to crypto_alloc_hash earlier and simply keep a reference
> >>>to algo but since I'm not sure if looking for modules in late-init-call
> >>>is good idea.
> >>
> >>Right, the allocation needs to occur in a sleepable context.
> >>
> >>If you're just hashing something small and have no need for
> >>hardware acceleration then lib/sha1.c is fine.
> >>
> >
> >Hi, yeah, it's just one message block hashing so I've switched
> >to lib/sha1.c. Herbert, I'm more interested in security analysis
> >-- would the sha1(msg), where the 'msg' is the kernel pointer
> >XOR'ed with random value and expanded to the 512 bits would be
> >safe enough for export to unprivilege users?
>
> Even if now we don't know an attacking way of sha1 reverse hashing,
> we may discover within 10 years. Many secure messages lost from
> hardware speedup and new algorithm attack. so, nobody can say it's
> abi safe.
>
Yes, I know. But there is a big difference between direct hash crack and
indirect crack caused by limited space of data used for such hash. That's
the reason why random cookie was used and xor production was expanded to
the whole message block.
> And, if you don't use perfect hash, you may have a hash collision
> risk. What's happen if different pointer makes same ID?
Well, strictly speaking this is pretty bad case for me. Of course this
wont lead to catastrophic results for user-space application I think
but definitely I would prefer to not have collisions here.
Guys, this become more and more complex, finally I fear someone
propose to do ideal hashing run-time ;) Maybe we can step back and
live with root-only and plain pointers here? I'm not sure who else
might need such facility except us, and if once there will be a candidate
-- we could take a look on hashing again and provide safe hashes there. No?
Cyrill
next prev parent reply other threads:[~2011-12-30 20:48 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-23 12:47 [patch 0/4] generic object ids, v2 Cyrill Gorcunov
2011-12-23 12:47 ` [patch 1/4] Add routine for generating an ID for kernel pointer Cyrill Gorcunov
2011-12-27 23:23 ` Andrew Morton
2011-12-28 7:42 ` Cyrill Gorcunov
2011-12-28 9:42 ` Andrew Morton
2011-12-28 9:43 ` Cyrill Gorcunov
2011-12-28 9:47 ` Pavel Emelyanov
2011-12-28 10:41 ` Cyrill Gorcunov
2011-12-27 23:33 ` Andrew Morton
2011-12-28 0:48 ` Randy Dunlap
2011-12-28 7:24 ` Cyrill Gorcunov
2011-12-27 23:54 ` Valdis.Kletnieks
2011-12-28 0:02 ` Andrew Morton
2011-12-28 7:22 ` Cyrill Gorcunov
2011-12-28 16:06 ` Tejun Heo
2011-12-28 16:18 ` Cyrill Gorcunov
2011-12-28 16:26 ` Tejun Heo
2011-12-28 16:40 ` Cyrill Gorcunov
2011-12-28 16:45 ` Tejun Heo
2011-12-28 16:53 ` Cyrill Gorcunov
2011-12-28 17:01 ` Tejun Heo
2011-12-28 17:14 ` Cyrill Gorcunov
2011-12-29 14:24 ` Cyrill Gorcunov
2011-12-29 16:14 ` Tejun Heo
2011-12-29 16:24 ` Cyrill Gorcunov
2011-12-30 0:23 ` Herbert Xu
2011-12-30 7:36 ` Cyrill Gorcunov
2011-12-30 20:31 ` KOSAKI Motohiro
2011-12-30 20:48 ` Cyrill Gorcunov [this message]
2011-12-30 23:51 ` KOSAKI Motohiro
2011-12-31 7:51 ` Cyrill Gorcunov
2012-01-02 12:18 ` bastien ROUCARIES
2012-01-02 21:14 ` Cyrill Gorcunov
2011-12-31 4:55 ` Kyle Moffett
2011-12-31 7:57 ` Cyrill Gorcunov
2011-12-23 12:47 ` [patch 2/4] proc: Show namespaces IDs in /proc/pid/ns/* files Cyrill Gorcunov
2012-01-04 6:02 ` Eric W. Biederman
2012-01-04 11:26 ` Cyrill Gorcunov
2012-01-04 17:56 ` Eric W. Biederman
2012-01-04 18:19 ` Cyrill Gorcunov
2011-12-23 12:47 ` [patch 3/4] proc: Show open file ID in /proc/pid/fdinfo/* Cyrill Gorcunov
2011-12-23 12:47 ` [patch 4/4] proc: Show IDs of objects cloned with CLONE_ in proc Cyrill Gorcunov
-- strict thread matches above, loose matches on Subject: below --
2011-12-22 12:56 [patch 0/4] kernel generic object IDs series Cyrill Gorcunov
2011-12-22 12:56 ` [patch 1/4] Add routine for generating an ID for kernel pointer Cyrill Gorcunov
2011-12-28 16:51 ` Alan Cox
2011-12-28 17:05 ` Cyrill Gorcunov
2011-12-28 17:21 ` Alan Cox
2011-12-28 17:35 ` Cyrill Gorcunov
2011-12-28 19:48 ` Cyrill Gorcunov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111230204836.GP4806@moon \
--to=gorcunov@gmail.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=glommer@parallels.com \
--cc=herbert@gondor.hengli.com.au \
--cc=kosaki.motohiro@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthltc@us.ibm.com \
--cc=penberg@kernel.org \
--cc=segoon@openwall.com \
--cc=tj@kernel.org \
--cc=xemul@parallels.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).