From patchwork Sat Jul 20 23:07:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Adami X-Patchwork-Id: 2830865 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 21FF99F3EB for ; Sat, 20 Jul 2013 23:14:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 31AF120144 for ; Sat, 20 Jul 2013 23:14:28 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A28720117 for ; Sat, 20 Jul 2013 23:14:27 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V0gM2-0006Rp-S8; Sat, 20 Jul 2013 23:14:23 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V0gM0-0002qo-Ga; Sat, 20 Jul 2013 23:14:20 +0000 Received: from mail-ea0-x229.google.com ([2a00:1450:4013:c01::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V0gLx-0002qV-UQ for linux-arm-kernel@lists.infradead.org; Sat, 20 Jul 2013 23:14:18 +0000 Received: by mail-ea0-f169.google.com with SMTP id h15so3131536eak.28 for ; Sat, 20 Jul 2013 16:13:56 -0700 (PDT) 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=GWZUr9wRw9Hn4iqmymBhFs0s9rank9hguzMtuwpe5qE=; b=CKF8jkRlaKSBSf9oPdIMvXaU20nKBjNPKF5m4UjPcFTZzrf4jju5hzDcv5zWXFjzjy nU23z1URm7eLRTCJwGwm6Re9y1opIF4mHv1kFQU0vYFRMtlu4aV8LarjsIsS67zbftfb sPJtnRaHP+hvgE8ZdM6Ag/Pa1V7tqb4Sp+ABbpOnAIomZAJ597+hXUnyUaierBdYhzXp veqav/dmcF00Ka/A/2dKx7pK8G+L2AF26KHln6e0eluLnKSnw73SU+Xq2TKUWwG2nCdP 6DNZkVkVl8w8/SK1Flo2UcZZX7eipR8FIPLbtzwRST0Wj5F/Ld/yACDC+mPosrweQe8V LSKQ== X-Received: by 10.14.0.131 with SMTP id 3mr21106496eeb.98.1374361672795; Sat, 20 Jul 2013 16:07:52 -0700 (PDT) Received: from mizar.localdomain (host133-7-dynamic.20-79-r.retail.telecomitalia.it. [79.20.7.133]) by mx.google.com with ESMTPSA id n45sm38768929eew.1.2013.07.20.16.07.51 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Jul 2013 16:07:52 -0700 (PDT) From: Andrea Adami To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] pxa: sharpsl_param: fix invalid memory access in sharpsl_save_param() Date: Sun, 21 Jul 2013 01:07:50 +0200 Message-Id: <1374361670-3214-1-git-send-email-andrea.adami@gmail.com> X-Mailer: git-send-email 1.8.1.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130720_191418_142305_AE11043A X-CRM114-Status: GOOD ( 11.33 ) X-Spam-Score: -2.0 (--) Cc: Marko Katic , Russell King , linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marko Katic Unbreak kernel boot (tested with kexecboot) Patch was sent twice upstrream: http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/137284.html Devices that call sharpsl_save_param() will hang on boot due to a memcpy call that uses a physical address that is no longer * accessible. Fix his by converting the physical address into a virtual one. Signed-off-by: Marko Katic [andrea.adami@gmail.com: checkpatch.pl dislikes void * param_start] Signed-off-by: Andrea Adami --- 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..b70b13a 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;