Received: by 10.223.185.116 with SMTP id b49csp1088147wrg; Fri, 23 Feb 2018 11:43:11 -0800 (PST) X-Google-Smtp-Source: AH8x2250A2nuTWjFEL997NQpLl+UBFPX6iV7AXTcOERfyhjCFORCgnCSk26mAWM9Z+MExb+vGzxS X-Received: by 10.98.64.73 with SMTP id n70mr2836618pfa.142.1519414991185; Fri, 23 Feb 2018 11:43:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519414991; cv=none; d=google.com; s=arc-20160816; b=bmsrGxtJ1XNYvynTcP5UTgOBSB9cWoFKuknNv7+a12DAnYV+TYPrsjbA0kRn/WTico 5oUMq47VzMnOss4G6i1EkrZ7v+ASomFgFahx65USKMMEePJRq/a/TCOcBmiVV8cJXNbS +dLa4izv03eSQojWAaQzjOlA4jCGvy17qVHG0RPbdDYgaun3GUyQmeGC8sOiuVzF6OuV 7j5ovNYBkT9s5pLFcUPFNZ8ValCW90bOsTPETo+l/k6ExmK5L96DdH1t6eQ5/dVWSxBu Q9kV/THvQBTPQ1xWLDYN2/1Z5Y2rM5plsB6Q66cFNAjNBsdDxidBnJ5eUJU9F4+CZjAL HlxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=RCRA+djcp+TCUoTNte5suF2wPVhqaYKS6tvoSWgfV5M=; b=zFPoLipEmtycYshyfffW7eJl+ohc/E0+Bz3q8Dw3oyJfSZ+pCRPMMo4VDU8XjKsubK yIBzRHc5vFujefjear0oWvjukrNxEhI9UAAKor1KTbarUPGQu9jT+vyzXI5sxArXRgM9 UeOKD02vUzo+J/YYOROTTWiISwhS3iTGu5nYx45rh+3gYAmij34FB28jNzOoTTjloSEr 0TD1xn0QW5X+V6UAdEuV1qmdn3e+t1uYWrcLROVVVPiDwfesiu6BrnPcOOZIRzTP35ee 78JM77sWvMnKhIFKG2S72bzWlXsMJWjy8UnmtsyJyuKbG8L0zO6FZ+NtJ6FB262cS3Gb 3gjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w34-v6si2196492pla.686.2018.02.23.11.42.56; Fri, 23 Feb 2018 11:43:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754816AbeBWTmT (ORCPT + 99 others); Fri, 23 Feb 2018 14:42:19 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44960 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934411AbeBWSse (ORCPT ); Fri, 23 Feb 2018 13:48:34 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id ADAE8FDC; Fri, 23 Feb 2018 18:48:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Ard Biesheuvel , Mark Rutland , Arnd Bergmann , Will Deacon Subject: [PATCH 4.9 139/145] arm64: fix warning about swapper_pg_dir overflow Date: Fri, 23 Feb 2018 19:27:25 +0100 Message-Id: <20180223170742.674594702@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170724.669759283@linuxfoundation.org> References: <20180223170724.669759283@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 12f043ff2b28fa64c9123b454cbe30a8a9e1967e upstream. With 4 levels of 16KB pages, we get this warning about the fact that we are copying a whole page into an array that is declared as having only two pointers for the top level of the page table: arch/arm64/mm/mmu.c: In function 'paging_init': arch/arm64/mm/mmu.c:528:2: error: 'memcpy' writing 16384 bytes into a region of size 16 overflows the destination [-Werror=stringop-overflow=] This is harmless since we actually reserve a whole page in the definition of the array that comes from, and just the extern declaration is short. The pgdir is initialized to zero either way, so copying the actual entries here seems like the best solution. Acked-by: Ard Biesheuvel Acked-by: Mark Rutland Signed-off-by: Arnd Bergmann Signed-off-by: Will Deacon [slightly adapted to apply on 4.9] Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- arch/arm64/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -479,7 +479,7 @@ void __init paging_init(void) * To do this we need to go via a temporary pgd. */ cpu_replace_ttbr1(__va(pgd_phys)); - memcpy(swapper_pg_dir, pgd, PAGE_SIZE); + memcpy(swapper_pg_dir, pgd, PGD_SIZE); cpu_replace_ttbr1(swapper_pg_dir); pgd_clear_fixmap();