xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com, Julien Grall <jgrall@amazon.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 1/2] xen/arm: kernel: Propagate the error if we fail to decompress the kernel
Date: Tue, 6 Apr 2021 20:15:29 +0100	[thread overview]
Message-ID: <5540671d-bd03-dc67-2c2f-e95f746c1030@xen.org> (raw)
In-Reply-To: <20210402152105.29387-2-julien@xen.org>



On 02/04/2021 16:21, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> Currently, we are ignoring any error from perform_gunzip() and replacing
> the compressed kernel with the "uncompressed" kernel.
> 
> If there is a gzip failure, then it means that the output buffer may
> contain garbagge. So it can result to various sort of behavior that may
> be difficult to root cause.
> 
> In case of failure, free the output buffer and propagate the error.
> We also need to adjust the return check for kernel_compress() as
> perform_gunzip() may return a positive value.
> 
> Take the opportunity to adjust the code style for the check.
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>
> ---
>   xen/arch/arm/kernel.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
> index ab78689ed2a6..f6b60ab77355 100644
> --- a/xen/arch/arm/kernel.c
> +++ b/xen/arch/arm/kernel.c
> @@ -292,6 +292,12 @@ static __init int kernel_decompress(struct bootmodule *mod)
>       iounmap(input);
>       vunmap(output);
>   
> +    if ( rc )
> +    {
> +        free_domheap_pages(pages);

This breaks the build. I am not sure how I managed to test it before... 
I will send a v2.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2021-04-06 19:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02 15:21 [PATCH 0/2] xen/arm: Couple of bug fixes when decompressing kernels Julien Grall
2021-04-02 15:21 ` [PATCH 1/2] xen/arm: kernel: Propagate the error if we fail to decompress the kernel Julien Grall
2021-04-06 19:15   ` Julien Grall [this message]
2021-04-02 15:21 ` [PATCH 2/2] xen/gunzip: Allow perform_gunzip() to be called multiple times Julien Grall
2021-04-06  7:40   ` Jan Beulich
2021-04-07 10:39   ` Jan Beulich
2021-04-07 18:18     ` Julien Grall
2021-04-06  7:45 ` [PATCH 0/2] xen/arm: Couple of bug fixes when decompressing kernels Jan Beulich
2021-04-06 14:13   ` Julien Grall
2021-04-06 18:31 ` Julien Grall

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=5540671d-bd03-dc67-2c2f-e95f746c1030@xen.org \
    --to=julien@xen.org \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jgrall@amazon.com \
    --cc=sstabellini@kernel.org \
    --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 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).