Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2204915imm; Mon, 28 May 2018 03:55:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpUpJnjigiDAHZxsnAlYcFGB2hF3CgGbSLa2+tNoWdPTa44rU3Tozi2wfZn4H8WzH2tHVNQ X-Received: by 2002:a62:9099:: with SMTP id q25-v6mr13125542pfk.66.1527504921994; Mon, 28 May 2018 03:55:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527504921; cv=none; d=google.com; s=arc-20160816; b=Bj0BCLQslhj8Q77CvaYXIoFzOeqekEWB8kv61hdZ1uIZ97RR6WN3UhpUSiXCTw7C8X g2JNz24T32Tl3sewZOghvlvjFDhH294nrzgUtTLc4zPKtMxrmMAcZOjEH48Olpl6JPg4 NJsZrdy79moKF07GdoyYLHlQNwnbzEWCo9b0RmkTLBDEyO11sgmsUUNO1xBuO8thLJIE yZVhP5YQNEm/83Si4mv09VY+3OWVokOqeMrRx3teiJdDZ1FTsKu1aXOhubiYnsKOSySa yHT1j9UxPWeDRIixYAYpYbVzU+rVHz2U4St6Pe3LT13FjC1G9i1739fv/a+4UWEKp4zq c3rA== 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:dkim-signature :arc-authentication-results; bh=9zYbP5sOyRIAP64PrPEVr9WgXteaB4O3SBVgdSqciGo=; b=lRzQcxTxDTr6O9ODKoH2rTUl/s5iFCDDofhFQrgRQf7FYY8Gs2mhMKexP3NpNxRdlj Zk6ByboI62JJlm9ITkcNOLiIe8t7/BhcTMiUlEumQmu8wDWCaDIHNnrTdg0vqgpgoNTL N1VQiJhTWZXwWb/5PBAuyr9QACAxTCKffRjpXApFM4gdqtbVu3ZPBe+OcILre+c155NZ mWJ59MI5ds51wLoNpI+DsgusH80e/Z6zvm7andTUlkoWcxntkLzkzX6jfhuxeotWlCfq /U9VaFDUZZz+w+BcRzn+EqeT54Wi0QdclZ0hiBs7fvprgz5uQxWHXUwUzhwjKYgfMxAn MlkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NISbMM5s; 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 a12-v6si30051707plp.225.2018.05.28.03.55.07; Mon, 28 May 2018 03:55:21 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=NISbMM5s; 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 S1164321AbeE1Kyz (ORCPT + 99 others); Mon, 28 May 2018 06:54:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:43468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163941AbeE1Kyk (ORCPT ); Mon, 28 May 2018 06:54:40 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1E4D820845; Mon, 28 May 2018 10:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504879; bh=xSC1XoFSiaEADFhXK9K3aQ5HVvSYCRqkehizbRJKom4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NISbMM5srKs9vVHGKliEwcQydwVuoch8pKgs6ceiNWzm/536IF/muwuJMie8rudy+ 1j1YnKtA+hPDsAdwhG8bjgSGGXACyOg594USodJC4hpCaRE1L1xOgyIZ9/BAwf9DhE QtBnDL/5XUbpySG6KnXGESV7Tjqb7i7YN5VtdPHE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Jinbum Park , Russell King , Sasha Levin Subject: [PATCH 4.14 297/496] ARM: 8748/1: mm: Define vdso_start, vdso_end as array Date: Mon, 28 May 2018 12:01:22 +0200 Message-Id: <20180528100332.342431607@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jinbum Park [ Upstream commit 73b9160d0dfe44dfdaffd6465dc1224c38a4a73c ] Define vdso_start, vdso_end as array to avoid compile-time analysis error for the case of built with CONFIG_FORTIFY_SOURCE. and, since vdso_start, vdso_end are used in vdso.c only, move extern-declaration from vdso.h to vdso.c. If kernel is built with CONFIG_FORTIFY_SOURCE, compile-time error happens at this code. - if (memcmp(&vdso_start, "177ELF", 4)) The size of "&vdso_start" is recognized as 1 byte, but n is 4, So that compile-time error is reported. Acked-by: Kees Cook Signed-off-by: Jinbum Park Signed-off-by: Russell King Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arm/include/asm/vdso.h | 2 -- arch/arm/kernel/vdso.c | 12 +++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) --- a/arch/arm/include/asm/vdso.h +++ b/arch/arm/include/asm/vdso.h @@ -12,8 +12,6 @@ struct mm_struct; void arm_install_vdso(struct mm_struct *mm, unsigned long addr); -extern char vdso_start, vdso_end; - extern unsigned int vdso_total_pages; #else /* CONFIG_VDSO */ --- a/arch/arm/kernel/vdso.c +++ b/arch/arm/kernel/vdso.c @@ -39,6 +39,8 @@ static struct page **vdso_text_pagelist; +extern char vdso_start[], vdso_end[]; + /* Total number of pages needed for the data and text portions of the VDSO. */ unsigned int vdso_total_pages __ro_after_init; @@ -197,13 +199,13 @@ static int __init vdso_init(void) unsigned int text_pages; int i; - if (memcmp(&vdso_start, "\177ELF", 4)) { + if (memcmp(vdso_start, "\177ELF", 4)) { pr_err("VDSO is not a valid ELF object!\n"); return -ENOEXEC; } - text_pages = (&vdso_end - &vdso_start) >> PAGE_SHIFT; - pr_debug("vdso: %i text pages at base %p\n", text_pages, &vdso_start); + text_pages = (vdso_end - vdso_start) >> PAGE_SHIFT; + pr_debug("vdso: %i text pages at base %p\n", text_pages, vdso_start); /* Allocate the VDSO text pagelist */ vdso_text_pagelist = kcalloc(text_pages, sizeof(struct page *), @@ -218,7 +220,7 @@ static int __init vdso_init(void) for (i = 0; i < text_pages; i++) { struct page *page; - page = virt_to_page(&vdso_start + i * PAGE_SIZE); + page = virt_to_page(vdso_start + i * PAGE_SIZE); vdso_text_pagelist[i] = page; } @@ -229,7 +231,7 @@ static int __init vdso_init(void) cntvct_ok = cntvct_functional(); - patch_vdso(&vdso_start); + patch_vdso(vdso_start); return 0; }