All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Kees Cook <keescook@chromium.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Liu hua <sdu.liu@huawei.com>,
	"msalter@redhat.com" <msalter@redhat.com>,
	Rabin Vincent <rabin@rab.in>,
	Nikolay Borisov <Nikolay.Borisov@arm.com>,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	Tomasz Figa <t.figa@samsung.com>, Rob Herring <robh@kernel.org>,
	Doug Anderson <dianders@google.com>,
	Jason Wessel <jason.wessel@windriver.com>,
	Laura Abbott <lauraa@codeaurora.org>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 8/8] ARM: mm: allow text and rodata sections to be read-only
Date: Mon, 11 Aug 2014 14:30:55 +0100	[thread overview]
Message-ID: <20140811133055.GA15853@arm.com> (raw)
In-Reply-To: <1407423713-4160-9-git-send-email-keescook@chromium.org>

On Thu, Aug 07, 2014 at 04:01:53PM +0100, Kees Cook wrote:
> This introduces CONFIG_DEBUG_RODATA, making kernel text and rodata
> read-only. Additionally, this splits rodata from text so that rodata can
> also be NX, which may lead to wasted memory when aligning to SECTION_SIZE.
> The read-only areas are made writable during ftrace updates and kexec.

[...]

> diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
> index 1ac184f2bdd8..4423a565ef6f 100644
> --- a/arch/arm/kernel/machine_kexec.c
> +++ b/arch/arm/kernel/machine_kexec.c
> @@ -164,11 +164,11 @@ void machine_kexec(struct kimage *image)
>  	reboot_code_buffer = page_address(image->control_code_page);
>  
>  	/* Prepare parameters for reboot_code_buffer*/
> +	set_kernel_text_rw();
>  	kexec_start_address = image->start;
>  	kexec_indirection_page = page_list;
>  	kexec_mach_type = machine_arch_type;
> -	kexec_boot_atags = dt_mem ?: image->start
> -				     - KEXEC_ARM_ZIMAGE_OFFSET
> +	kexec_boot_atags = dt_mem ?: image->start - KEXEC_ARM_ZIMAGE_OFFSET
>  				     + KEXEC_ARM_ATAGS_OFFSET;

Minor nit: but this patch and the kexec patch earlier in the series seem to
move this line around in different ways without actually changing the code.
I guess you just got a screwy rebase?

Will

WARNING: multiple messages have this Message-ID (diff)
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/8] ARM: mm: allow text and rodata sections to be read-only
Date: Mon, 11 Aug 2014 14:30:55 +0100	[thread overview]
Message-ID: <20140811133055.GA15853@arm.com> (raw)
In-Reply-To: <1407423713-4160-9-git-send-email-keescook@chromium.org>

On Thu, Aug 07, 2014 at 04:01:53PM +0100, Kees Cook wrote:
> This introduces CONFIG_DEBUG_RODATA, making kernel text and rodata
> read-only. Additionally, this splits rodata from text so that rodata can
> also be NX, which may lead to wasted memory when aligning to SECTION_SIZE.
> The read-only areas are made writable during ftrace updates and kexec.

[...]

> diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
> index 1ac184f2bdd8..4423a565ef6f 100644
> --- a/arch/arm/kernel/machine_kexec.c
> +++ b/arch/arm/kernel/machine_kexec.c
> @@ -164,11 +164,11 @@ void machine_kexec(struct kimage *image)
>  	reboot_code_buffer = page_address(image->control_code_page);
>  
>  	/* Prepare parameters for reboot_code_buffer*/
> +	set_kernel_text_rw();
>  	kexec_start_address = image->start;
>  	kexec_indirection_page = page_list;
>  	kexec_mach_type = machine_arch_type;
> -	kexec_boot_atags = dt_mem ?: image->start
> -				     - KEXEC_ARM_ZIMAGE_OFFSET
> +	kexec_boot_atags = dt_mem ?: image->start - KEXEC_ARM_ZIMAGE_OFFSET
>  				     + KEXEC_ARM_ATAGS_OFFSET;

Minor nit: but this patch and the kexec patch earlier in the series seem to
move this line around in different ways without actually changing the code.
I guess you just got a screwy rebase?

Will

  reply	other threads:[~2014-08-11 13:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07 15:01 [PATCH v2 0/8] arm: support CONFIG_RODATA Kees Cook
2014-08-07 15:01 ` Kees Cook
2014-08-07 15:01 ` [PATCH 1/8] arm: use generic fixmap.h Kees Cook
2014-08-07 15:01   ` Kees Cook
2014-08-07 17:38   ` Leif Lindholm
2014-08-07 17:38     ` Leif Lindholm
2014-08-07 17:47     ` Kees Cook
2014-08-07 17:47       ` Kees Cook
2014-08-07 15:01 ` [PATCH 2/8] arm: fixmap: implement __set_fixmap() Kees Cook
2014-08-07 15:01   ` Kees Cook
2014-08-07 15:01 ` [PATCH 3/8] arm: mm: reduce fixmap kmap from 32 to 16 CPUS Kees Cook
2014-08-07 15:01   ` Kees Cook
2014-08-07 22:18   ` Rob Herring
2014-08-07 22:18     ` Rob Herring
2014-08-08 10:16     ` Leif Lindholm
2014-08-08 10:16       ` Leif Lindholm
2014-08-09  0:11     ` Kees Cook
2014-08-09  0:11       ` Kees Cook
2014-08-07 15:01 ` [PATCH 4/8] arm: use fixmap for text patching when text is RO Kees Cook
2014-08-07 15:01   ` Kees Cook
2014-08-07 15:01 ` [PATCH 5/8] ARM: kexec: Make .text R/W in machine_kexec Kees Cook
2014-08-07 15:01   ` Kees Cook
2014-08-07 15:01 ` [PATCH 6/8] arm: kgdb: Handle read-only text / modules Kees Cook
2014-08-07 15:01   ` Kees Cook
2014-08-07 15:01 ` [PATCH 7/8] ARM: mm: allow non-text sections to be non-executable Kees Cook
2014-08-07 15:01   ` Kees Cook
2014-08-07 15:01 ` [PATCH 8/8] ARM: mm: allow text and rodata sections to be read-only Kees Cook
2014-08-07 15:01   ` Kees Cook
2014-08-11 13:30   ` Will Deacon [this message]
2014-08-11 13:30     ` Will Deacon
2014-08-11 15:41     ` Kees Cook
2014-08-11 15:41       ` Kees Cook
2014-08-07 20:43 ` [PATCH v2 0/8] arm: support CONFIG_RODATA Laura Abbott
2014-08-07 20:43   ` Laura Abbott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140811133055.GA15853@arm.com \
    --to=will.deacon@arm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Nikolay.Borisov@arm.com \
    --cc=dianders@google.com \
    --cc=jason.wessel@windriver.com \
    --cc=keescook@chromium.org \
    --cc=lauraa@codeaurora.org \
    --cc=leif.lindholm@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=msalter@redhat.com \
    --cc=nicolas.pitre@linaro.org \
    --cc=rabin@rab.in \
    --cc=robh@kernel.org \
    --cc=sdu.liu@huawei.com \
    --cc=t.figa@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.