Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1335592 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2016-02-16 17:10 +0100 |
| Last post | 2016-02-17 00:20 +0100 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 1/2] ARM: mm: DEBUG_RODATA makes no sense with XIP_KERNEL Arnd Bergmann <arnd@arndb.de> - 2016-02-16 17:10 +0100
Re: [PATCH 1/2] ARM: mm: DEBUG_RODATA makes no sense with XIP_KERNEL Kees Cook <keescook@chromium.org> - 2016-02-16 19:50 +0100
Re: [PATCH 1/2] ARM: mm: DEBUG_RODATA makes no sense with XIP_KERNEL Kees Cook <keescook@chromium.org> - 2016-02-16 21:40 +0100
Re: [PATCH 1/2] ARM: mm: DEBUG_RODATA makes no sense with XIP_KERNEL Kees Cook <keescook@chromium.org> - 2016-02-17 00:20 +0100
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-02-16 17:10 +0100 |
| Subject | [PATCH 1/2] ARM: mm: DEBUG_RODATA makes no sense with XIP_KERNEL |
| Message-ID | <r2Qmm-1Is-13@gated-at.bofh.it> |
When CONFIG_DEBUG_ALIGN_RODATA is set, we get a link error:
arch/arm/mm/built-in.o:(.data+0x4bc): undefined reference to `__start_rodata_section_aligned'
However, this combination is useless, as XIP_KERNEL implies that all the
RODATA is already marked readonly, so both CONFIG_DEBUG_RODATA and
CONFIG_DEBUG_ALIGN_RODATA (which depends on the other) are not
needed with XIP_KERNEL, and this patches enforces that using a Kconfig
dependency.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 25362dc496ed ("ARM: 8501/1: mm: flip priority of CONFIG_DEBUG_RODATA")
---
arch/arm/mm/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index fbf2296388ce..8894045caba9 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -1039,7 +1039,7 @@ config ARCH_SUPPORTS_BIG_ENDIAN
config DEBUG_RODATA
bool "Make kernel text and rodata read-only"
- depends on MMU
+ depends on MMU && !XIP_KERNEL
default y if CPU_V7
help
If this is set, kernel text and rodata memory will be made
--
2.7.0
[toc] | [next] | [standalone]
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2016-02-16 19:50 +0100 |
| Message-ID | <r2SRc-3dV-9@gated-at.bofh.it> |
| In reply to | #1335592 |
On Tue, Feb 16, 2016 at 8:03 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> When CONFIG_DEBUG_ALIGN_RODATA is set, we get a link error:
>
> arch/arm/mm/built-in.o:(.data+0x4bc): undefined reference to `__start_rodata_section_aligned'
>
> However, this combination is useless, as XIP_KERNEL implies that all the
> RODATA is already marked readonly, so both CONFIG_DEBUG_RODATA and
> CONFIG_DEBUG_ALIGN_RODATA (which depends on the other) are not
> needed with XIP_KERNEL, and this patches enforces that using a Kconfig
> dependency.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 25362dc496ed ("ARM: 8501/1: mm: flip priority of CONFIG_DEBUG_RODATA")
Oh, hm, I didn't see this before sending my fix for the rodata start issue.
> ---
> arch/arm/mm/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> index fbf2296388ce..8894045caba9 100644
> --- a/arch/arm/mm/Kconfig
> +++ b/arch/arm/mm/Kconfig
> @@ -1039,7 +1039,7 @@ config ARCH_SUPPORTS_BIG_ENDIAN
>
> config DEBUG_RODATA
> bool "Make kernel text and rodata read-only"
> - depends on MMU
> + depends on MMU && !XIP_KERNEL
If we do this, we need to probably clean up the xip linker script to
remove all the references to DEBUG_*RODATA too.
-Kees
> default y if CPU_V7
> help
> If this is set, kernel text and rodata memory will be made
> --
> 2.7.0
>
--
Kees Cook
Chrome OS & Brillo Security
[toc] | [prev] | [next] | [standalone]
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2016-02-16 21:40 +0100 |
| Message-ID | <r2UzF-4qz-25@gated-at.bofh.it> |
| In reply to | #1335592 |
On Tue, Feb 16, 2016 at 8:03 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> When CONFIG_DEBUG_ALIGN_RODATA is set, we get a link error:
>
> arch/arm/mm/built-in.o:(.data+0x4bc): undefined reference to `__start_rodata_section_aligned'
>
> However, this combination is useless, as XIP_KERNEL implies that all the
> RODATA is already marked readonly, so both CONFIG_DEBUG_RODATA and
> CONFIG_DEBUG_ALIGN_RODATA (which depends on the other) are not
> needed with XIP_KERNEL, and this patches enforces that using a Kconfig
> dependency.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 25362dc496ed ("ARM: 8501/1: mm: flip priority of CONFIG_DEBUG_RODATA")
For this and the 2/2 patch:
Acked-by: Kees Cook <keescook@chromium.org>
I've sent follow-up to clean up the XIP linker script too, if you want
to take that as the 3rd patch in this series of fixes.
-Kees
> ---
> arch/arm/mm/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> index fbf2296388ce..8894045caba9 100644
> --- a/arch/arm/mm/Kconfig
> +++ b/arch/arm/mm/Kconfig
> @@ -1039,7 +1039,7 @@ config ARCH_SUPPORTS_BIG_ENDIAN
>
> config DEBUG_RODATA
> bool "Make kernel text and rodata read-only"
> - depends on MMU
> + depends on MMU && !XIP_KERNEL
> default y if CPU_V7
> help
> If this is set, kernel text and rodata memory will be made
> --
> 2.7.0
>
--
Kees Cook
Chrome OS & Brillo Security
[toc] | [prev] | [next] | [standalone]
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2016-02-17 00:20 +0100 |
| Message-ID | <r2X4u-6dy-19@gated-at.bofh.it> |
| In reply to | #1335809 |
On Tue, Feb 16, 2016 at 12:31 PM, Kees Cook <keescook@chromium.org> wrote:
> On Tue, Feb 16, 2016 at 8:03 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> When CONFIG_DEBUG_ALIGN_RODATA is set, we get a link error:
>>
>> arch/arm/mm/built-in.o:(.data+0x4bc): undefined reference to `__start_rodata_section_aligned'
>>
>> However, this combination is useless, as XIP_KERNEL implies that all the
>> RODATA is already marked readonly, so both CONFIG_DEBUG_RODATA and
>> CONFIG_DEBUG_ALIGN_RODATA (which depends on the other) are not
>> needed with XIP_KERNEL, and this patches enforces that using a Kconfig
>> dependency.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Fixes: 25362dc496ed ("ARM: 8501/1: mm: flip priority of CONFIG_DEBUG_RODATA")
>
> For this and the 2/2 patch:
>
> Acked-by: Kees Cook <keescook@chromium.org>
>
> I've sent follow-up to clean up the XIP linker script too, if you want
> to take that as the 3rd patch in this series of fixes.
Arnd, when you send your 2 patches to the tracker, can you also send
mine (so the ordering is correct)?
Thanks!
-Kees
--
Kees Cook
Chrome OS & Brillo Security
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web