From: dromede@gmail.com (dromede at gmail.com)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] [ARM] sharpsl_param: fix invalid memory access in sharpsl_save_param()
Date: Thu, 13 Dec 2012 15:44:53 +0100 [thread overview]
Message-ID: <1355409893-24200-1-git-send-email-dromede@gmail.com> (raw)
From: Marko Katic <dromede.gmail.com>
Devices that call sharpsl_save_param() will hang on boot due to
a memcpy call that uses physical addresses that are no longer
valid. This is caused by the following commit:
commit 72662e01088394577be4a3f14da94cf87bea2591
Author: Will Deacon <will.deacon@arm.com>
Date: Wed Nov 23 12:03:27 2011 +0000
ARM: head.S: only include __turn_mmu_on in the initial identity mapping
Tested on Zaurus corgi/poodle/spitz devices.
Signed-off-by: Marko Katic <dromede@gmail.com>
---
arch/arm/common/sharpsl_param.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c
index d56c932..04555dc 100644
--- a/arch/arm/common/sharpsl_param.c
+++ b/arch/arm/common/sharpsl_param.c
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
+#include <asm/memory.h>
#include <asm/mach/sharpsl_param.h>
/*
@@ -41,7 +42,8 @@ EXPORT_SYMBOL(sharpsl_param);
void sharpsl_save_param(void)
{
- memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info));
+ void *param_start = phys_to_virt(PARAM_BASE);
+ memcpy(&sharpsl_param, param_start, sizeof(struct sharpsl_param_info));
if (sharpsl_param.comadj_keyword != COMADJ_MAGIC)
sharpsl_param.comadj=-1;
--
1.7.10.4
next reply other threads:[~2012-12-13 14:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-13 14:44 dromede at gmail.com [this message]
2012-12-13 14:50 ` [PATCH] [ARM] sharpsl_param: fix invalid memory access in sharpsl_save_param() Will Deacon
2012-12-13 15:54 ` Marko Katić
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=1355409893-24200-1-git-send-email-dromede@gmail.com \
--to=dromede@gmail.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;
as well as URLs for NNTP newsgroup(s).