Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1473374

Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory map by md5 value

From "Rafael J. Wysocki" <rafael@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory map by md5 value
Date 2016-08-31 14:00 +0200
Message-ID <scclr-1X7-9@gated-at.bofh.it> (permalink)
References <sbb86-41k-21@gated-at.bofh.it> <sc1zH-3CS-5@gated-at.bofh.it> <scbz5-1Gy-39@gated-at.bofh.it> <sccbM-1TJ-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 31, 2016 at 1:43 PM, Pavel Machek <pavel@ucw.cz> wrote:
> On Wed 2016-08-31 13:07:31, Pavel Machek wrote:
>> On Wed 2016-08-31 02:27:53, Rafael J. Wysocki wrote:
>> > On Monday, August 29, 2016 12:35:40 AM Chen Yu wrote:

[cut]

>> > >
>> > > +#define MD5_DIGEST_SIZE 16
>> > > +
>> > >  struct restore_data_record {
>> > >   unsigned long jump_address;
>> > >   unsigned long jump_address_phys;
>> > >   unsigned long cr3;
>> > >   unsigned long magic;
>> > > + u8 e820_digest[MD5_DIGEST_SIZE];
>> > >  };
>> > >
>> > >  #define RESTORE_MAGIC    0x123456789ABCDEF0UL
>> >
>> > You're changing the image header format, so RESTORE_MAGIC needs to be updated
>> > too.
>>
>> With !CONFIG_HIBERNATION_CHECK_E820, magic nothing changes in on-disk
>> format. (Unused space is now used).
>>
>> If there's hibernation kernel is CONFIG_HIBERNATION_CHECK_E820, and
>> restore kernel is !CONFIG_HIBERNATION_CHECK_E820, we won't check the
>> E820, and that should be acceptable.
>>
>> If there's hibernation kernel is !CONFIG_HIBERNATION_CHECK_E820, and
>> restore kernel is CONFIG_HIBERNATION_CHECK_E820, we'll fail the E820
>> check, and refuse to resume. That is also acceptable (and similar
>> result we'd get with RESTORE_MAGIC).. but the message will be
>> confusing.
>>
>> Ok, so I guess we should change the magic.
>
> Actually, no, simply changing the magic is not enough. I guess we
> should change the magic, and either add "e820_digest_available" field,
> or specify that e820_digest == {0,} means that no digest is
> available. We should either ignore the digest in
> CONFIG_HIBERNATION_CHECK_E820 case if it is not available, or fail
> with different message.

Something like that.

Kernels with the same RESTORE_MAGIC have to use the same header format
and interpret all of the fields in it in the same way.

Thanks,
Rafael

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH][v8] PM / hibernate: Verify the consistent of e820 memory map by md5 value Chen Yu <yu.c.chen@intel.com> - 2016-08-28 18:30 +0200
  Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Pavel Machek <pavel@ucw.cz> - 2016-08-28 18:40 +0200
  Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Borislav Petkov <bp@alien8.de> - 2016-08-29 07:10 +0200
    Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Pavel Machek <pavel@ucw.cz> - 2016-08-29 09:20 +0200
      Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Borislav Petkov <bp@alien8.de> - 2016-08-29 16:50 +0200
        Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value joeyli <jlee@suse.com> - 2016-08-30 10:40 +0200
          Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory map by md5 value "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-08-30 13:50 +0200
            Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Pavel Machek <pavel@ucw.cz> - 2016-09-08 23:20 +0200
              Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Chen Yu <yu.c.chen@intel.com> - 2016-09-09 09:30 +0200
                Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Pavel Machek <pavel@ucw.cz> - 2016-09-09 09:40 +0200
        Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory map by md5 value "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-08-30 13:50 +0200
    Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value "Rafael J. Wysocki" <rafael@kernel.org> - 2016-08-29 15:50 +0200
      Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Pavel Machek <pavel@ucw.cz> - 2016-08-29 17:20 +0200
        Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory map by md5 value "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-08-30 14:00 +0200
          Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Pavel Machek <pavel@ucw.cz> - 2016-08-30 22:00 +0200
            Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value "Rafael J. Wysocki" <rafael@kernel.org> - 2016-08-31 00:00 +0200
              Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Pavel Machek <pavel@ucw.cz> - 2016-08-31 13:10 +0200
  Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory map by md5 value "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-08-31 02:30 +0200
    Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Pavel Machek <pavel@ucw.cz> - 2016-08-31 13:10 +0200
      Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value Pavel Machek <pavel@ucw.cz> - 2016-08-31 13:50 +0200
        Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory  map by md5 value "Rafael J. Wysocki" <rafael@kernel.org> - 2016-08-31 14:00 +0200

csiph-web