[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 2/6] livepatch: Add limit of 2MB to payload .bss sections.



>>> On 16.09.16 at 17:29, <konrad.wilk@xxxxxxxxxx> wrote:
> --- a/xen/common/livepatch_elf.c
> +++ b/xen/common/livepatch_elf.c
> @@ -86,6 +86,10 @@ static int elf_resolve_sections(struct livepatch_elf *elf, 
> const void *data)
>                      delta < sizeof(Elf_Ehdr) ? "at ELF header" : "is past 
> end");
>              return -EINVAL;
>          }
> +        else if ( (sec[i].sec->sh_flags & (SHF_WRITE | SHF_ALLOC)) &&
> +                  sec[i].sec->sh_type == SHT_NOBITS &&
> +                  sec[i].sec->sh_size > BSS_MAX_SIZE )
> +            return -EINVAL;
>  
>          sec[i].data = data + delta;
>          /* Name is populated in elf_resolve_section_names. */
> --- a/xen/include/xen/livepatch.h
> +++ b/xen/include/xen/livepatch.h
> @@ -30,6 +30,8 @@ struct xen_sysctl_livepatch_op;
>  #define ELF_LIVEPATCH_FUNC    ".livepatch.funcs"
>  #define ELF_LIVEPATCH_DEPENDS ".livepatch.depends"
>  #define ELF_BUILD_ID_NOTE      ".note.gnu.build-id"
> +/* Arbitrary limit. */
> +#define BSS_MAX_SIZE            MB(2)

Hmm, this wasn't quite what I was thinking about in the v5
comments: I really meant to unify this and the other 2Mb limit
into one (and then obviously with a name that's more generic).
I'm sorry for not having expressed this in an explicit enough
way.

Jan


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.