lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 31 Aug 2016 13:54:04 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Pavel Machek <pavel@....cz>
Cc:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Chen Yu <yu.c.chen@...el.com>,
        Linux PM <linux-pm@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        "the arch/x86 maintainers" <x86@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Lee@...r.kernel.org, Chun-Yi <jlee@...e.com>,
        Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory
 map by md5 value

On Wed, Aug 31, 2016 at 1:43 PM, Pavel Machek <pavel@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ