[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170427025630.GA10602@dhcp-128-65.nay.redhat.com>
Date: Thu, 27 Apr 2017 10:56:30 +0800
From: Dave Young <dyoung@...hat.com>
To: xlpang@...hat.com
Cc: Baoquan He <bhe@...hat.com>, kexec@...ts.infradead.org,
Petr Tesarik <ptesarik@...e.cz>, linux-kernel@...r.kernel.org,
Eric Biederman <ebiederm@...ssion.com>,
Hari Bathini <hbathini@...ux.vnet.ibm.com>,
akpm@...ux-foundation.org,
Michael Holzheu <holzheu@...ux.vnet.ibm.com>
Subject: Re: [PATCH v4 3/3] kdump: Protect vmcoreinfo data under the crash
memory
[snip]
> >> index 43cdb00..a29e9ad 100644
> >> --- a/kernel/crash_core.c
> >> +++ b/kernel/crash_core.c
> >> @@ -15,9 +15,12 @@
> >>
> >> /* vmcoreinfo stuff */
> >> static unsigned char *vmcoreinfo_data;
> >> -size_t vmcoreinfo_size;
> >> +static size_t vmcoreinfo_size;
> >> u32 *vmcoreinfo_note;
> >>
> >> +/* trusted vmcoreinfo, e.g. we can make a copy in the crash memory */
> > May make it clearer like:
> > /* Trusted vmcoreinfo copy in the kdump reserved memory */
>
> My thought is that it is in crash_core.c now which should be independent of kexec/kdump,
> so I used "e.g. ..." just like one use case.
Ok, then it is fine.
[snip]
> >> static int kimage_add_entry(struct kimage *image, kimage_entry_t entry)
> >> {
> >> if (*image->entry != 0)
> >> @@ -598,6 +632,11 @@ void kimage_free(struct kimage *image)
> >> if (image->file_mode)
> >> kimage_file_post_load_cleanup(image);
> >>
> >> + if (image->vmcoreinfo_data_copy) {
> >> + crash_update_vmcoreinfo_safecopy(NULL);
> >> + vunmap(image->vmcoreinfo_data_copy);
> >> + }
> >> +
> > Should move above chunk before the freeing of the actual page?
>
> It should be fine, because it is allocated from the reserved memory, it doesn't
> need to be freed. Anyway I can move it above to avoid confusion. Thanks!
>
Yes, it looks better, thanks for explanation.
Thanks
Dave
Powered by blists - more mailing lists