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


Groups > linux.kernel > #1206484

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

From joeyli <jlee@suse.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints
Date 2015-08-13 05:30 +0200
Message-ID <pWRnk-7WT-7@gated-at.bofh.it> (permalink)
References <pWb4J-57z-3@gated-at.bofh.it> <pWb4K-57z-43@gated-at.bofh.it> <pWQKC-6Ye-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Yu, 

Thanks for your reviewing.

On Thu, Aug 13, 2015 at 02:45:32AM +0000, Chen, Yu C wrote:
> Hi Chun-yi,
> On Tue, 2015-08-11 at 14:16 +0800, Lee, Chun-Yi wrote:
> 
> > +/* A page used to keep hibernation keys */
> > +static struct hibernation_keys *hibernation_keys;
> > +
> > +void __init parse_hibernation_keys(u64 phys_addr, u32 data_len)
> > +{
> > +	struct setup_data *hibernation_setup_data;
> > +
> > +	/* Reserve keys memory, will copy and erase in init_hibernation_keys() */
> > +	keys_phys_addr = phys_addr + sizeof(struct setup_data);
> > +	memblock_reserve(keys_phys_addr, sizeof(struct hibernation_keys));
> > +
> > +	/* clear hibernation_data */
> > +	hibernation_setup_data = early_memremap(phys_addr, data_len);
> > +	if (!hibernation_setup_data)
> > +		return;
> > +
> should we invoke memblock_free if early_memremap failed?
> 
> Best Regards,
> Yu
> 
> 

Should not free memblock reservation of key data.

Using memblock_reserve is for reserve hibernation key until
init_hibernation_keys() copy key data to arbitrary allocated page.
Using early_memremap is for cleaning the setup_data header that's
used to carry key. That above 2 actions are different purposes.

So, even the action of cleaning setup_data failed, it doesn't
affect to the action for reserve hibernation key by memblock until
copy it.


Thanks a lot!
Joey Lee
--
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/

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


Thread

[PATCH v2 00/16] Signature verification of hibernate snapshot "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
  [PATCH v2 15/16] PM / hibernate: Bypass verification logic on legacy BIOS "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
  [PATCH v2 01/16] PM / hibernate: define HMAC algorithm and digest size of hibernation "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
  [PATCH v2 03/16] x86/boot: Public getting random boot function "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
  [PATCH v2 05/16] x86/efi: Get entropy through EFI random number generator protocol "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
  [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
    Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and  erase footprints "Chen, Yu C" <yu.c.chen@intel.com> - 2015-08-13 04:50 +0200
      Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and  erase footprints joeyli <jlee@suse.com> - 2015-08-13 05:30 +0200
    Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and  erase footprints joeyli <jlee@suse.com> - 2015-08-13 16:40 +0200
  [PATCH v2 16/16] PM / hibernate: Document signature verification of hibernate snapshot "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
  [PATCH v2 04/16] x86/efi: Generating random number in EFI stub "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
  [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup data "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
    Re: [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup  data Pavel Machek <pavel@ucw.cz> - 2015-08-15 19:10 +0200
      Re: [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup data joeyli <jlee@suse.com> - 2015-08-16 07:40 +0200
      Re: [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup  data Jiri Kosina <jikos@kernel.org> - 2015-08-16 23:30 +0200
        Re: [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup data Nigel Cunningham <nigel@nigelcunningham.com.au> - 2015-08-17 09:00 +0200
  [PATCH v2 06/16] x86/efi: Generating random HMAC key for siging hibernate image "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
  [PATCH v2 02/16] x86/efi: Add get and set variable to EFI services pointer table "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:20 +0200
    Re: [PATCH v2 02/16] x86/efi: Add get and set variable to EFI  services pointer table Matt Fleming <matt@codeblueprint.co.uk> - 2015-08-19 18:40 +0200
  [PATCH v2 10/16] PM / hibernate: Generate and verify signature of hibernate snapshot "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:30 +0200
  [PATCH v2 14/16] PM / hibernate: Allow user trigger hibernation key re-generating "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:30 +0200
  [PATCH v2 13/16] PM / hibernate: Add configuration to enforce signature verification "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:30 +0200
  [PATCH v2 12/16] PM / hibernate: Forward signature verifying result and key to image kernel "Lee, Chun-Yi" <joeyli.kernel@gmail.com> - 2015-08-11 08:30 +0200

csiph-web