linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'crecklin@redhat.com'" <crecklin@redhat.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	Eric Biggers <ebiggers@kernel.org>
Cc: Simo Sorce <simo@redhat.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Linux PM <linux-pm@vger.kernel.org>,
	"Linux Crypto Mailing List" <linux-crypto@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v6 1/1] use crc32 instead of md5 for hibernation e820 integrity check
Date: Tue, 13 Apr 2021 09:09:53 +0000	[thread overview]
Message-ID: <493d2c11820a4fc8b66db381fc4e7904@AcuMS.aculab.com> (raw)
In-Reply-To: <862c8208-5809-9726-7e22-7a16fcd30edd@redhat.com>

From: Chris von Recklinghausen
> Sent: 12 April 2021 20:51
...
> > This is not about BIOS bugs. Hibernation is deep suspend/resume
> > grafted onto cold boot, and it is perfectly legal for the firmware to
> > present a different memory map to the OS after a cold boot. It is
> > Linux that decides that it can restore the entire system state from a
> > swap file, and carry on as if the cold boot was just a [firmware
> > assisted] suspend/resume.
> >
> > So forging collisions is *not* a concern here. Let's avoid accidental
> > or malicious, as those adjectives seem to confuse some people. The
> > bottom line is that there is no need to protect against deliberate
> > attempts to hide the fact that the memory map has changed, and so
> > there is no reason to use cryptographic hashes here.
> >
> How about :
> 
> The check is intended to differentiate between a resume (which expects
> an identical e820 map to the one saved in suspend), and a cold boot
> (which need not have an identical e820 map to that saved in suspend if
> any was done at all). It is not necessary here to protect against
> deliberate attempts to hide the fact that the memory map has changed, so
> crc32 is sufficient for detection.

That sort of implies that the 'resume' and 'cold boot' are
differenciated.

But the previous comment rather implies that it is the presence
of a valid saved image that signifies a 'resume'.

An interesting failure case would be moving the disk to a
different system.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

      parent reply	other threads:[~2021-04-13  9:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-12 14:09 [PATCH v6 1/1] use crc32 instead of md5 for hibernation e820 integrity check Chris von Recklinghausen
2021-04-12 17:45 ` Eric Biggers
2021-04-12 19:04   ` Chris von Recklinghausen
2021-04-12 19:20     ` Eric Biggers
2021-04-12 19:24       ` Chris von Recklinghausen
2021-04-12 19:27       ` Ard Biesheuvel
2021-04-12 19:51         ` Chris von Recklinghausen
2021-04-12 20:29           ` Ard Biesheuvel
2021-04-12 21:11             ` Simo Sorce
2021-04-13  9:09           ` David Laight [this message]

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=493d2c11820a4fc8b66db381fc4e7904@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=ardb@kernel.org \
    --cc=crecklin@redhat.com \
    --cc=decui@microsoft.com \
    --cc=ebiggers@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=simo@redhat.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).