From: Dave Young <dyoung@redhat.com>
To: xlpang@redhat.com
Cc: Baoquan He <bhe@redhat.com>,
kexec@lists.infradead.org, Petr Tesarik <ptesarik@suse.cz>,
linux-kernel@vger.kernel.org,
Eric Biederman <ebiederm@xmission.com>,
Hari Bathini <hbathini@linux.vnet.ibm.com>,
akpm@linux-foundation.org,
Michael Holzheu <holzheu@linux.vnet.ibm.com>
Subject: Re: [PATCH v4 3/3] kdump: Protect vmcoreinfo data under the crash memory
Date: Thu, 27 Apr 2017 10:56:30 +0800 [thread overview]
Message-ID: <20170427025630.GA10602@dhcp-128-65.nay.redhat.com> (raw)
In-Reply-To: <590066A2.4090309@redhat.com>
[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
next prev parent reply other threads:[~2017-04-27 2:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-20 11:39 [PATCH v4 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Xunlei Pang
2017-04-20 11:39 ` [PATCH v4 2/3] powerpc/fadump: Use the correct VMCOREINFO_NOTE_SIZE for phdr Xunlei Pang
2017-04-21 0:55 ` Xunlei Pang
2017-04-26 7:11 ` Dave Young
2017-04-27 7:38 ` Mahesh Jagannath Salgaonkar
2017-04-20 11:39 ` [PATCH v4 3/3] kdump: Protect vmcoreinfo data under the crash memory Xunlei Pang
2017-04-26 7:09 ` Dave Young
2017-04-26 9:21 ` Xunlei Pang
2017-04-27 2:56 ` Dave Young [this message]
2017-04-20 14:24 ` [PATCH v4 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Juergen Gross
2017-04-24 15:18 ` Michael Holzheu
2017-04-26 7:19 ` Dave Young
2017-04-26 9:51 ` Xunlei Pang
2017-04-26 10:18 ` Xunlei Pang
2017-04-27 3:06 ` Dave Young
2017-04-27 5:25 ` Xunlei Pang
2017-04-27 5:44 ` Dave Young
2017-04-27 6:08 ` Xunlei Pang
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=20170427025630.GA10602@dhcp-128-65.nay.redhat.com \
--to=dyoung@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=ebiederm@xmission.com \
--cc=hbathini@linux.vnet.ibm.com \
--cc=holzheu@linux.vnet.ibm.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ptesarik@suse.cz \
--cc=xlpang@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).