Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Wang Nan <wangnan0@huawei.com>
Cc: kexec@lists.infradead.org, Dave Young <dyoung@redhat.com>,
	Geng Hui <hui.geng@huawei.com>
Subject: Re: [PATCH] zImage-arm: init modified_cmdline with zero
Date: Sun, 11 May 2014 09:22:52 +0900	[thread overview]
Message-ID: <20140511002252.GR31760@verge.net.au> (raw)
In-Reply-To: <1399208633-62071-1-git-send-email-wangnan0@huawei.com>

On Sun, May 04, 2014 at 09:03:53PM +0800, Wang Nan wrote:
> This patch memset modified_cmdline after it alloced.
> 
> Without this patch, the header of command line always contains random
> value like following example:
> 
> kernel: 0x765fd008 kernel_size: 0x23b610
> memory range: [0x60000000 - 0x6fffffff] (256M)
> memory range: [0x78000000 - 0x9fffffff] (640M)
> ...
> kernel command line: "°¥氥䐶# elfcorehdr=0x77f00000 mem=130048K"
> 
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> Cc: Geng Hui <hui.geng@huawei.com>

Thanks, applied.

> 
> ---
>  kexec/arch/arm/kexec-zImage-arm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
> index 220826e..4b5d3f4 100644
> --- a/kexec/arch/arm/kexec-zImage-arm.c
> +++ b/kexec/arch/arm/kexec-zImage-arm.c
> @@ -378,6 +378,8 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
>  		if (!modified_cmdline)
>  			return -1;
>  
> +		memset(modified_cmdline, '\0', COMMAND_LINE_SIZE);
> +
>  		if (command_line) {
>  			(void) strncpy(modified_cmdline, command_line,
>  				       COMMAND_LINE_SIZE);
> -- 
> 1.8.4
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2014-05-11  8:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-04 13:03 [PATCH] zImage-arm: init modified_cmdline with zero Wang Nan
2014-05-11  0:22 ` Simon Horman [this message]

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=20140511002252.GR31760@verge.net.au \
    --to=horms@verge.net.au \
    --cc=dyoung@redhat.com \
    --cc=hui.geng@huawei.com \
    --cc=kexec@lists.infradead.org \
    --cc=wangnan0@huawei.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