From: Daniel Kiper <daniel.kiper@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: kexec@lists.infradead.org, xen-devel@lists.xensource.com,
kumagai-atsushi@mxc.nes.nec.co.jp
Subject: Re: [Xen-devel] [PATCH 2/7] elf: Increase buf size in get_pt_note_info()
Date: Fri, 12 Jul 2013 21:09:36 +0200 [thread overview]
Message-ID: <20130712190936.GA16948@debian70-amd64.local.net-space.pl> (raw)
In-Reply-To: <51E00CF9.7080604@citrix.com>
On Fri, Jul 12, 2013 at 03:04:41PM +0100, Andrew Cooper wrote:
> On 12/07/13 14:48, Daniel Kiper wrote:
> > get_pt_note_info() always ignores VMCOREINFO_XEN note
> > because buf size is too small. It does not have place
> > for \0 char which marks EOS. This patch fixes that bug
> > and VMCOREINFO_XEN note living in /proc/vmcore file
> > could be properly detected now.
> >
> > Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> > ---
> > elf_info.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/elf_info.c b/elf_info.c
> > index 0c1e36a..70a6dd2 100644
> > --- a/elf_info.c
> > +++ b/elf_info.c
> > @@ -310,7 +310,7 @@ get_pt_note_info(void)
> > {
> > int n_type, size_name, size_desc;
> > off_t offset, offset_desc;
> > - char buf[VMCOREINFO_XEN_NOTE_NAME_BYTES];
> > + char buf[VMCOREINFO_XEN_NOTE_NAME_BYTES + 1];
> > char note[MAX_SIZE_NHDR];
> >
> > nr_cpus = 0;
>
> Elf Note namesz is defined to include the terminating null character, so
> I would argue that VMCOREINFO_XEN_NOTE_NAME_BYTES is off-by-one.
I have checked that once again. By mistake I have assumed that
sizeof("string") does not take into account \0 char (like strlen()).
It means that in real buf could accommodate VMCOREINFO_XEN string
with EOS and relevant condition should be fixed instead of buf size.
I will fix it in second patch series release.
Thanks,
Daniel
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2013-07-12 19:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-12 13:48 [PATCH 0/7] Xen fixes and minor cleanups Daniel Kiper
2013-07-12 13:48 ` [PATCH 1/7] xen: Improve calculation of beginning of virtual address space Daniel Kiper
2013-07-12 13:48 ` [PATCH 2/7] elf: Increase buf size in get_pt_note_info() Daniel Kiper
2013-07-12 14:04 ` [Xen-devel] " Andrew Cooper
2013-07-12 19:09 ` Daniel Kiper [this message]
2013-07-12 13:48 ` [PATCH 3/7] xen: Take into account new frame table address since Xen 4.3 Daniel Kiper
2013-07-12 13:48 ` [PATCH 4/7] xen: Enforce page size only when xen-syms file is used Daniel Kiper
2013-07-12 13:48 ` [PATCH 5/7] Mute some compiler warnings Daniel Kiper
2013-07-12 14:12 ` [Xen-devel] " Andrew Cooper
2013-07-12 13:48 ` [PATCH 6/7] Use elf_getshdrstrndx() instead of elf_getshstrndx() Daniel Kiper
2013-07-12 13:48 ` [PATCH 7/7] Do not break progress messages Daniel Kiper
2013-07-12 14:01 ` [Xen-devel] [PATCH 0/7] Xen fixes and minor cleanups Andrew Cooper
2013-07-12 14:30 ` Daniel Kiper
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=20130712190936.GA16948@debian70-amd64.local.net-space.pl \
--to=daniel.kiper@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=kexec@lists.infradead.org \
--cc=kumagai-atsushi@mxc.nes.nec.co.jp \
--cc=xen-devel@lists.xensource.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