linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@redhat.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Izik Eidus <ieidus@redhat.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, kvm@vger.kernel.org, aarcange@redhat.com,
	chrisw@redhat.com, avi@redhat.com, dlaor@redhat.com,
	kamezawa.hiroyu@jp.fujitsu.com, cl@linux-foundation.org,
	corbet@lwn.net
Subject: Re: [PATCH 3/4] add ksm kernel shared memory driver.
Date: Tue, 2 Dec 2008 10:07:24 -0800	[thread overview]
Message-ID: <20081202180724.GC17607@acer.localdomain> (raw)
In-Reply-To: <20081128165806.172d1026@lxorguk.ukuu.org.uk>

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

thanks,
-chris

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-12-02 18:07 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-17  2:20 [PATCH 0/4] ksm - dynamic page sharing driver for linux v2 Izik Eidus
2008-11-17  2:20 ` [PATCH 1/4] Rmap: Add page_wrprotect() function Izik Eidus
2008-11-17  2:20   ` [PATCH 2/4] Add replace_page(): change the page pte is pointing to Izik Eidus
2008-11-17  2:20     ` [PATCH 3/4] add ksm kernel shared memory driver Izik Eidus
2008-11-17  2:20       ` [PATCH 4/4] MMU_NOTIFIRES: add set_pte_at_notify() Izik Eidus
2008-11-28 16:58       ` [PATCH 3/4] add ksm kernel shared memory driver Alan Cox
2008-12-02 18:07         ` Chris Wright [this message]
2008-12-02 18:13           ` Alan Cox
2008-12-02 21:24             ` Chris Wright
2008-12-02 21:37               ` Jonathan Corbet
2008-12-02 22:10               ` Alan Cox
2008-12-03 14:33                 ` Pavel Machek
2008-12-04  9:48                   ` Alan Cox
2008-11-20  7:44 ` [PATCH 0/4] ksm - dynamic page sharing driver for linux v2 Ryota OZAKI
2008-11-20  9:03   ` Izik Eidus
2008-11-20  9:13     ` Izik Eidus
2008-11-20  9:44       ` Ryota OZAKI
2008-11-28 12:57 ` Dmitri Monakhov
2008-11-28 13:51   ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2008-11-11 13:21 [PATCH 0/4] ksm - dynamic page sharing driver for linux Izik Eidus
2008-11-11 13:21 ` [PATCH 1/4] rmap: add page_wrprotect() function, Izik Eidus, Izik Eidus
2008-11-11 13:21   ` [PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another Izik Eidus, Izik Eidus
2008-11-11 13:21     ` [PATCH 3/4] add ksm kernel shared memory driver Izik Eidus, Izik Eidus
2008-11-11 20:38       ` Andrew Morton
2008-11-11 22:03         ` Andrea Arcangeli
2008-11-11 22:03       ` Jonathan Corbet
2008-11-11 22:17         ` Izik Eidus
2008-11-11 22:25           ` Jonathan Corbet
2008-11-11 22:31             ` Izik Eidus
2008-11-11 22:30           ` Jonathan Corbet
2008-11-11 22:38             ` Izik Eidus
2008-11-11 23:02             ` Izik Eidus
2008-11-11 23:03             ` Andrea Arcangeli
2008-11-11 22:49           ` Avi Kivity
2008-11-11 22:40         ` Valdis.Kletnieks
2008-11-13  6:13           ` Eric Rannaud
2008-11-11 22:43         ` Avi Kivity

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=20081202180724.GC17607@acer.localdomain \
    --to=chrisw@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=avi@redhat.com \
    --cc=cl@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=dlaor@redhat.com \
    --cc=ieidus@redhat.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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