Re: resuming swsusp twice

From: Pavel Machek (pavel_at_suse.cz)
Date: 07/15/05

  • Next message: Manfred Spraul: "[PATCH] forcedeth: TX handler changes (experimental)"
    Date:	Fri, 15 Jul 2005 10:38:30 +0200
    To: Andy Isaacson <adi@hexapodia.org>
    
    

    Hi!

    > > I of course won't say that this cannot happen, but by design, the
    > > swsusp
    > > signature is invalidated even before reading the image, so
    > > theoretically
    > > it should not happen.
    >
    > Yes, I'd seen that happen on earlier swsusps, so I was quite suprised
    > when it blew up like this.
    >
    > Perhaps the image should be more rigorously checked? I'm wishing that
    > it would verify that the header and the image matched, after it finishes
    > reading the image. For example, computing the hash
    >
    > MD5(header || image) (|| denotes "concatenate" in crypto pseudocode.)
    >
    > and storing that hash in a final trailing block. Additionally, of
    > course, as soon as the resume has read the image it should overwrite the
    > header; and the header should include jiffies or something along those
    > lines to ensure that it won't accidentally have the same contents as the
    > previous image's header.
    >
    > The hash doesn't have to be MD5; even a CRC should suffice I think...

    Actually, what you want is "if filesystems are newer than suspend
    image, panic" test. There is more than one way how that can happen.

    Are you sure you did not do

    suspend kernel 1
    boot kernel 2
    attempt to suspend kernel 2 but fail ("not enough swap space")
    boot kernel 1 ("and successfully resume, corrupting data")

    ?
                                                                    Pavel

    -- 
    teflon -- maybe it is a trademark, but it should not be.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Manfred Spraul: "[PATCH] forcedeth: TX handler changes (experimental)"

    Relevant Pages

    • Re: resuming swsusp twice
      ... >> signature is invalidated even before reading the image, ... > it would verify that the header and the image matched, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: How to determine integer values in a txt file?
      ... the fixed header, skip 2 bytes and read the 5th byte to determine how many ... The problem boils down to one of positioning and then reading - how it can ... the stream then the task is easy - just read the header in! ... really, quite easy to accomplish. ...
      (comp.lang.java.programmer)
    • Re: confused about word templates
      ... dialog and the ³same as previous² setting in the header and footer settings ... And congratulations on reading the documentation. ... stubborn as I am when I have a formatting problem. ... > textedit files are in word format and open in Word} ...
      (microsoft.public.mac.office.word)
    • Re: resuming swsusp twice
      ... it should only be an error message, ... the console was left on the swsusp VT ... [snip severe ext3 damage] ... it would verify that the header and the image matched, ...
      (Linux-Kernel)
    • Re: Parsing Multipart formdata
      ... Read the header, ... Start reading the part header, ... Stop reading into the string buffer when you see the boundary again. ... The array of bytes is your binary data. ...
      (microsoft.public.dotnet.languages.csharp)