All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: andrew.cooper3@citrix.com, xen-devel@lists.xenproject.org,
	ross.lagerwall@citrix.com
Subject: Re: [PATCH v5 2/4] livepatch: Add limit of 2MB to payload .bss sections.
Date: Mon, 12 Sep 2016 01:56:35 -0600	[thread overview]
Message-ID: <57D67BD3020000780010DE25@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1473608912-5913-3-git-send-email-konrad.wilk@oracle.com>

>>> On 11.09.16 at 17:48, <konrad.wilk@oracle.com> wrote:
> The initial patch: 11ff40fa7bb5fdcc69a58d0fec49c904ffca4793
> "xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op" caps the
> size of the binary at 2MB. We follow that in capping the size
> of the .BSSes to be at maximum 2MB.
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> ---
> Cc: Ross Lagerwall <ross.lagerwall@citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> 
> v5: Initial submission. Came about from conversation about
>     "livepatch: Clear .bss when payload is reverted"
>    - Use only one sh_flags comparison instead of two.
>    - And check for the _right_ combination (WA).
> ---
>  xen/common/livepatch_elf.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/common/livepatch_elf.c b/xen/common/livepatch_elf.c
> index cda9b27..e2264ad 100644
> --- a/xen/common/livepatch_elf.c
> +++ b/xen/common/livepatch_elf.c
> @@ -86,7 +86,15 @@ static int elf_resolve_sections(struct livepatch_elf *elf, const void *data)
>                      delta < sizeof(Elf_Ehdr) ? "at ELF header" : "is past end");
>              return -EINVAL;
>          }
> -

I think this blank line would better be retained (after the addition you
make).

> +        else if ( (sec[i].sec->sh_flags & (SHF_WRITE | SHF_ALLOC)) &&
> +                  sec[i].sec->sh_type == SHT_NOBITS &&
> +                  sec[i].sec->sh_size > MB(2) )
> +        {
> +            /* Arbitrary limit. */

I guess this is as arbitrary as the one in verify_payload(). I'd like to
recommend making this a #define, with the comment put next to it.

> +            dprintk(XENLOG_ERR, LIVEPATCH "%s: Section [%u] .bss is bigger than 2MB!\n",
> +                    elf->name, i);

The other limit violation doesn't get a message logged.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-09-12  7:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-11 15:48 [PATCH v5] Livepatch fixes and general features for Xen 4.8 Konrad Rzeszutek Wilk
2016-09-11 15:48 ` [PATCH v5 1/4] livepatch/docs: Document .bss not being cleared, and .data potentially having changed values Konrad Rzeszutek Wilk
2016-09-12  7:49   ` Jan Beulich
2016-09-13 15:59     ` Konrad Rzeszutek Wilk
2016-09-13 16:12       ` Jan Beulich
2016-09-11 15:48 ` [PATCH v5 2/4] livepatch: Add limit of 2MB to payload .bss sections Konrad Rzeszutek Wilk
2016-09-12  7:56   ` Jan Beulich [this message]
2016-09-13 16:04   ` Ross Lagerwall
2016-09-11 15:48 ` [PATCH v5 3/4] livepatch: NOP if func->new_addr is zero Konrad Rzeszutek Wilk
2016-09-12  8:04   ` Jan Beulich
2016-09-11 15:48 ` [PATCH v5 4/4] livepach: Add .livepatch.hooks functions and test-case Konrad Rzeszutek Wilk

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=57D67BD3020000780010DE25@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=ross.lagerwall@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.