From patchwork Fri Oct 16 10:46:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yalin wang X-Patchwork-Id: 7413921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B5F57BEEA4 for ; Fri, 16 Oct 2015 10:48:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF0962073E for ; Fri, 16 Oct 2015 10:48:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AEC92073D for ; Fri, 16 Oct 2015 10:48:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zn2XB-0000KA-8m; Fri, 16 Oct 2015 10:46:49 +0000 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zn2X8-0008Ia-Tp for linux-arm-kernel@lists.infradead.org; Fri, 16 Oct 2015 10:46:47 +0000 Received: by palb17 with SMTP id b17so12078780pal.2 for ; Fri, 16 Oct 2015 03:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=r2brze3+g4mLoINYShtwmgpzqv79yAZIkXeUoW5Fvkc=; b=ssoHUyCq0BA1CgoQ8LigEAPQqEZep7v6WM1AVxOi0QXKR/F63pPwJWqbrCLOqZNnNU 469iJYGw9JrWOcBqbuR9lPsFpRm226jj+fS/rJhrC6ZHZCpph/LTO1LQYb4SjtQ0rT0p ge+8vFnEqh04WSlSDHn4gh+mgD0MkYymonDlVQmE4uVmWmu8moCXOvtnqvOGZGqn1Fdv GdCdm2dkNGwggiWEt/pNy5haYNBAoJn8iFdWZG5c950A0Ogau05IS/NPvmrWGZik46Fh LElckKSIeNiwUUd5bVrmPX/bB4fcy4wnvqNL2k5+J7IbMvdujylzk4LMYhS9u9w35bkE T8XA== X-Received: by 10.66.251.35 with SMTP id zh3mr15763499pac.121.1444992386003; Fri, 16 Oct 2015 03:46:26 -0700 (PDT) Received: from ubuntu.localdomain ([17.87.20.100]) by smtp.googlemail.com with ESMTPSA id fx4sm20483351pbb.92.2015.10.16.03.46.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Oct 2015 03:46:25 -0700 (PDT) From: yalin wang To: catalin.marinas@arm.com, will.deacon@arm.com, ard.biesheuvel@linaro.org, matt.fleming@intel.com, yalin.wang2010@gmail.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: change to use memmove in efi-stub Date: Fri, 16 Oct 2015 18:46:07 +0800 Message-Id: <1444992367-11121-1-git-send-email-yalin.wang2010@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151016_034647_006514_FFC86AA8 X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 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.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Change to use memmove(), in case the dest address overlap with the source address. Signed-off-by: yalin wang --- arch/arm64/kernel/efi-stub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c index 816120e..b6dc44b 100644 --- a/arch/arm64/kernel/efi-stub.c +++ b/arch/arm64/kernel/efi-stub.c @@ -59,7 +59,7 @@ efi_status_t __init handle_kernel_image(efi_system_table_t *sys_table_arg, } *image_addr = *reserve_addr + TEXT_OFFSET; } - memcpy((void *)*image_addr, old_image_addr, kernel_size); + memmove((void *)*image_addr, old_image_addr, kernel_size); *reserve_size = kernel_memsize; }