Re: Thinking aloud.

Theodore Ts'o <[email protected]> Thu, 25 Oct 2012 12:06:50 -0400
Newsgroups gmane.linux.swsusp.devel
Message-ID <[email protected]>
On Thu, Oct 25, 2012 at 08:32:10PM +1100, Nigel Cunningham wrote:
> I started some work on this today, and it occurred to me (wrongly?)
> that if I go down the Fletcher-32 path, it's pointless. If the
> Fletcher-32 checksums match, I have to do the SHA1 to check the
> pages really are the same. If they don't match, I still have to
> calculate the SHA1 of the new contents so I can store it. So I may
> as well just calculate the SHA1 for every page and compare them. Am
> I making a mistake somewhere?

Hmm, good point.  I forgot that in the case where they don't match,
you need to calculate the SHA1 for the next suspend/resume cycle.

> I like the page flags idea... I'll look into it some more. Would it
> work on non-x86?

It should.  As long as the VM supports read-only pages (which is
pretty much all of the major ones, since you can't have any kind of
security if you don't --- imagine what might happen if a bad guy can
modify the text page of the shared libc image, for example).

       	   	     	    	   	       - Ted