From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: kexec: fix segment memory addresses check
Date: Tue, 16 Oct 2012 19:17:42 +0100 [thread overview]
Message-ID: <20121016181742.GO23979@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <1350410244-12240-1-git-send-email-aaro.koskinen@iki.fi>
On Tue, Oct 16, 2012 at 06:57:24PM +0100, Aaro Koskinen wrote:
> Commit c564df4db85aac8d1d65a56176a0a25f46138064 (ARM: 7540/1: kexec:
> Check segment memory addresses) added a safety check with accidentally
> reversed condition, and broke kexec functionality on ARM. Fix this.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
> arch/arm/kernel/machine_kexec.c | 7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
> index e29c333..8ef8c93 100644
> --- a/arch/arm/kernel/machine_kexec.c
> +++ b/arch/arm/kernel/machine_kexec.c
> @@ -45,10 +45,9 @@ int machine_kexec_prepare(struct kimage *image)
> for (i = 0; i < image->nr_segments; i++) {
> current_segment = &image->segment[i];
>
> - err = memblock_is_region_memory(current_segment->mem,
> - current_segment->memsz);
> - if (err)
> - return - EINVAL;
> + if (!memblock_is_region_memory(current_segment->mem,
> + current_segment->memsz))
> + return -EINVAL;
>
> err = get_user(header, (__be32*)current_segment->buf);
> if (err)
> --
> 1.7.2.5
Thanks for this Aaro:
Acked-by: Will Deacon <will.deacon@arm.com>
Please stick it in the patch system.
Will
prev parent reply other threads:[~2012-10-16 18:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 17:57 [PATCH] ARM: kexec: fix segment memory addresses check Aaro Koskinen
2012-10-16 18:17 ` Will Deacon [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=20121016181742.GO23979@mudshark.cambridge.arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.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