From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Wei Liu <wei.liu2@citrix.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 1/4] libelf: section index 0 is special
Date: Tue, 6 Dec 2016 08:09:17 -0500 [thread overview]
Message-ID: <20161206130917.GA29246@localhost.localdomain> (raw)
In-Reply-To: <5846B45B02000078001259E5@prv-mh.provo.novell.com>
On Tue, Dec 06, 2016 at 04:51:39AM -0700, Jan Beulich wrote:
> When iterating over sections, table entry zero needs to be ignored.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
> --- a/xen/common/libelf/libelf-dominfo.c
> +++ b/xen/common/libelf/libelf-dominfo.c
> @@ -536,7 +536,7 @@ elf_errorstatus elf_xen_parse(struct elf
> if ( xen_elfnotes == 0 )
> {
> count = elf_shdr_count(elf);
> - for ( i = 0; i < count; i++ )
> + for ( i = 1; i < count; i++ )
> {
> shdr = elf_shdr_by_index(elf, i);
> if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(shdr), 1) )
> --- a/xen/common/libelf/libelf-loader.c
> +++ b/xen/common/libelf/libelf-loader.c
> @@ -79,7 +79,7 @@ elf_errorstatus elf_init(struct elf_bina
>
> /* Find symbol table and symbol string table. */
> count = elf_shdr_count(elf);
> - for ( i = 0; i < count; i++ )
> + for ( i = 1; i < count; i++ )
> {
> shdr = elf_shdr_by_index(elf, i);
> if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(shdr), 1) )
> --- a/xen/common/libelf/libelf-tools.c
> +++ b/xen/common/libelf/libelf-tools.c
> @@ -153,7 +153,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_na
> const char *sname;
> unsigned i;
>
> - for ( i = 0; i < count; i++ )
> + for ( i = 1; i < count; i++ )
> {
> shdr = elf_shdr_by_index(elf, i);
> if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(shdr), 1) )
>
>
>
> libelf: section index 0 is special
>
> When iterating over sections, table entry zero needs to be ignored.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/common/libelf/libelf-dominfo.c
> +++ b/xen/common/libelf/libelf-dominfo.c
> @@ -536,7 +536,7 @@ elf_errorstatus elf_xen_parse(struct elf
> if ( xen_elfnotes == 0 )
> {
> count = elf_shdr_count(elf);
> - for ( i = 0; i < count; i++ )
> + for ( i = 1; i < count; i++ )
> {
> shdr = elf_shdr_by_index(elf, i);
> if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(shdr), 1) )
> --- a/xen/common/libelf/libelf-loader.c
> +++ b/xen/common/libelf/libelf-loader.c
> @@ -79,7 +79,7 @@ elf_errorstatus elf_init(struct elf_bina
>
> /* Find symbol table and symbol string table. */
> count = elf_shdr_count(elf);
> - for ( i = 0; i < count; i++ )
> + for ( i = 1; i < count; i++ )
> {
> shdr = elf_shdr_by_index(elf, i);
> if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(shdr), 1) )
> --- a/xen/common/libelf/libelf-tools.c
> +++ b/xen/common/libelf/libelf-tools.c
> @@ -153,7 +153,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_na
> const char *sname;
> unsigned i;
>
> - for ( i = 0; i < count; i++ )
> + for ( i = 1; i < count; i++ )
> {
> shdr = elf_shdr_by_index(elf, i);
> if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(shdr), 1) )
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-12-06 13:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 11:46 [PATCH 0/4] libelf: misc adjustments Jan Beulich
2016-12-06 11:51 ` [PATCH 1/4] libelf: section index 0 is special Jan Beulich
2016-12-06 13:09 ` Konrad Rzeszutek Wilk [this message]
2016-12-06 13:51 ` Roger Pau Monné
2016-12-06 11:52 ` [PATCH 2/4] libelf: use UINT_MAX Jan Beulich
2016-12-06 13:09 ` Konrad Rzeszutek Wilk
2016-12-06 13:49 ` Roger Pau Monné
2016-12-06 14:09 ` Jan Beulich
2016-12-06 14:42 ` Roger Pau Monné
2016-12-06 11:52 ` [PATCH 3/4] libelf: type adjustments Jan Beulich
2016-12-06 13:14 ` Konrad Rzeszutek Wilk
2016-12-06 13:55 ` Roger Pau Monné
2016-12-06 11:53 ` [PATCH 4/4] libelf: treat phdr and shdr similarly Jan Beulich
2016-12-06 13:27 ` Konrad Rzeszutek Wilk
2016-12-06 13:37 ` Jan Beulich
2016-12-06 13:54 ` Konrad Rzeszutek Wilk
2016-12-06 14:41 ` Roger Pau Monné
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=20161206130917.GA29246@localhost.localdomain \
--to=konrad.wilk@oracle.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.