From patchwork Thu Dec 13 14:44:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dromede@gmail.com X-Patchwork-Id: 1874641 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 915653FC64 for ; Thu, 13 Dec 2012 14:48:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TjA2C-0003CX-Gd; Thu, 13 Dec 2012 14:45:12 +0000 Received: from mail-bk0-f49.google.com ([209.85.214.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TjA29-0003C2-4K for linux-arm-kernel@lists.infradead.org; Thu, 13 Dec 2012 14:45:09 +0000 Received: by mail-bk0-f49.google.com with SMTP id jm19so1095485bkc.36 for ; Thu, 13 Dec 2012 06:45:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=/3uKMRl5s9jsQyW0JJIXbkbp7uSllQz5v1bgSt1bwF0=; b=aaMKv70dwlDD0NXjVNgn8KHfZa0u8dKgB7MZhcRigVcTKsLdmt8W4gIN101YssIerf cO2FipL4mnZtp6n9oNioaLdq86+M9QHW1BBOOvWG6kZw/97oh960tAV7ri6KKVNBlVGE 8YAvNBGei41cswlRxja4P7jpDEwYoF3iFFm3iYsqfYicZSM4Epm4ymFCBRk4+xhOx2Sw XN10ZIezMjfA39vt3aEEvkfcchLJcVgueGi0G/vFep3qNL/eIRirdQ3lRdljz2+FOPa2 8XnWTDFxMT+X9FGKqdpFI0IzIOINDoJmAGMMoV1OaVKLnG+VoHZqg1ROkXOchFhv/COw bCdg== Received: by 10.204.129.202 with SMTP id p10mr1129379bks.56.1355409906390; Thu, 13 Dec 2012 06:45:06 -0800 (PST) Received: from dromedary.sx76x.gigaset.net (93-142-254-158.adsl.net.t-com.hr. [93.142.254.158]) by mx.google.com with ESMTPS id y11sm1605424bkw.8.2012.12.13.06.45.02 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Dec 2012 06:45:05 -0800 (PST) From: dromede@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 Message-Id: <1355409893-24200-1-git-send-email-dromede@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121213_094509_348469_B7840EA8 X-CRM114-Status: GOOD ( 11.45 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dromede[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Marko Katic , will.deacon@arm.com, richard.purdie@linuxfoundation.org, linux@arm.linux.org.uk X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Marko Katic 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 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 --- 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 #include #include +#include #include /* @@ -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;