Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757413AbbGGXFt (ORCPT ); Tue, 7 Jul 2015 19:05:49 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:34989 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752555AbbGGXFk (ORCPT ); Tue, 7 Jul 2015 19:05:40 -0400 MIME-Version: 1.0 In-Reply-To: <1436300428-21163-39-git-send-email-yinghai@kernel.org> References: <1436300428-21163-1-git-send-email-yinghai@kernel.org> <1436300428-21163-39-git-send-email-yinghai@kernel.org> Date: Tue, 7 Jul 2015 16:05:40 -0700 X-Google-Sender-Auth: EXk0nJjSt0zFOWTQbMDoViaAAY4 Message-ID: Subject: Re: [PATCH 38/42] x86: Fix typo in mark_rodata_ro From: Kees Cook To: Yinghai Lu Cc: "H. Peter Anvin" , Baoquan He , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1420 Lines: 40 On Tue, Jul 7, 2015 at 1:20 PM, Yinghai Lu wrote: > In the comment, should use cleanup_highmap(). > and also remove not needed cast for _brk_end, as it is > unsigned long. > > Signed-off-by: Yinghai Lu > --- > arch/x86/mm/init_64.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c > index 257ba4b..3b7453a 100644 > --- a/arch/x86/mm/init_64.c > +++ b/arch/x86/mm/init_64.c > @@ -1054,9 +1054,9 @@ void mark_rodata_ro(void) > * of the PMD will remain mapped executable. > * > * Any PMD which was setup after the one which covers _brk_end > - * has been zapped already via cleanup_highmem(). > + * has been zapped already via cleanup_highmap(). > */ > - all_end = roundup((unsigned long)_brk_end, PMD_SIZE); > + all_end = roundup(_brk_end, PMD_SIZE); > set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT); > > rodata_test(); This should also fix the casts in xen/mmu.c, kernel/setup.c, and the earlier cast in mm/init_64.c. -Kees -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/