lkml.org 
[lkml]   [2008]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] add ksm kernel shared memory driver.
On Tue, 2 Dec 2008 10:07:24 -0800
Chris Wright <chrisw@redhat.com> wrote:

> * Alan Cox (alan@lxorguk.ukuu.org.uk) wrote:
> > > + r = !memcmp(old_digest, sha1_item->sha1val, SHA1_DIGEST_SIZE);
> > > + mutex_unlock(&sha1_lock);
> > > + if (r) {
> > > + char *old_addr, *new_addr;
> > > + old_addr = kmap_atomic(oldpage, KM_USER0);
> > > + new_addr = kmap_atomic(newpage, KM_USER1);
> > > + r = !memcmp(old_addr+PAGEHASH_LEN, new_addr+PAGEHASH_LEN,
> > > + PAGE_SIZE-PAGEHASH_LEN);
> >
> > NAK - this isn't guaranteed to be robust so you could end up merging
> > different pages one provided by a malicious attacker.
>
> I presume you're referring to the digest comparison. While there's
> theoretical concern of hash collision, it's mitigated by hmac(sha1)
> so the attacker can't brute force for known collisions.

Using current known techniques. A random collision is just as bad news.

This code simply isn't fit for the kernel.



\
 
 \ /
  Last update: 2008-12-02 19:17    [W:0.050 / U:0.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site