mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	BAREBOX <barebox@lists.infradead.org>
Subject: Re: [PATCH 0/7] ARM: Map sections RO/XN
Date: Fri, 13 Jun 2025 14:44:15 +0200	[thread overview]
Message-ID: <0ee3b17b-a544-4899-9cbf-3e01dc676510@pengutronix.de> (raw)
In-Reply-To: <20250613-arm-mmu-xn-ro-v1-0-60f05c6e7b4b@pengutronix.de>

Hello Sascha,

On 6/13/25 09:58, Sascha Hauer wrote:
> So far we mapped all RAM as read write with execute permission. This
> series series hardens this a bit. The barebox text segment will be
> mapped readonly with execute permission, the RO data section as readonly
> without execute permission and the remaining RAM will lose its execute
> permission.

Very nice. Thanks for working on this.

> I tested this series on ARMv7 and ARMv8. I am not confident though that
> there are no regressions, so this new behaviour is behind a Kconfig
> option. It is default-y, but can be disabled for debugging purposses.
> Once this series has proven stable it can be removed.
> 
> I haven't tested it on ARMv4-v6 due to the lack of hardware. I tried on
> Qemu, but the write protection did not work as expected. This should be
> resolved before merging.

I will give it a try and see what I find.

Cheers,
Ahmad

> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> Sascha Hauer (7):
>       memory: request RO data section as separate region
>       ARM: pass barebox base to mmu_early_enable()
>       ARM: mmu: move ARCH_MAP_WRITECOMBINE to header
>       ARM: MMU: map memory for barebox proper pagewise
>       ARM: MMU: map text segment ro and data segments execute never
>       ARM: MMU64: map memory for barebox proper pagewise
>       ARM: MMU64: map text segment ro and data segments execute never
> 
>  arch/arm/Kconfig                 |  12 +++++
>  arch/arm/cpu/mmu-common.h        |   4 ++
>  arch/arm/cpu/mmu_32.c            |  86 +++++++++++++++++++++++++++------
>  arch/arm/cpu/mmu_64.c            | 101 +++++++++++++++++++++++++++++++++++----
>  arch/arm/cpu/uncompress.c        |   9 ++--
>  arch/arm/include/asm/mmu.h       |   2 +-
>  arch/arm/include/asm/pgtable64.h |   1 +
>  arch/arm/lib32/barebox.lds.S     |   3 +-
>  arch/arm/lib64/barebox.lds.S     |   5 +-
>  common/memory.c                  |   6 ++-
>  include/mmu.h                    |   1 +
>  11 files changed, 198 insertions(+), 32 deletions(-)
> ---
> base-commit: 340e930140e76827cf5cac731e6afe2836e28242
> change-id: 20250613-arm-mmu-xn-ro-1a1d996496ae
> 
> Best regards,

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




      parent reply	other threads:[~2025-06-13 12:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13  7:58 Sascha Hauer
2025-06-13  7:58 ` [PATCH 1/7] memory: request RO data section as separate region Sascha Hauer
2025-06-13  9:15   ` Ahmad Fatoum
2025-06-13  7:58 ` [PATCH 2/7] ARM: pass barebox base to mmu_early_enable() Sascha Hauer
2025-06-13  9:17   ` Ahmad Fatoum
2025-06-13  7:58 ` [PATCH 3/7] ARM: mmu: move ARCH_MAP_WRITECOMBINE to header Sascha Hauer
2025-06-13  9:18   ` Ahmad Fatoum
2025-06-13  7:58 ` [PATCH 4/7] ARM: MMU: map memory for barebox proper pagewise Sascha Hauer
2025-06-13  9:23   ` Ahmad Fatoum
2025-06-13  7:58 ` [PATCH 5/7] ARM: MMU: map text segment ro and data segments execute never Sascha Hauer
2025-06-13 10:12   ` Ahmad Fatoum
2025-06-13 10:36   ` Ahmad Fatoum
2025-06-13  7:58 ` [PATCH 6/7] ARM: MMU64: map memory for barebox proper pagewise Sascha Hauer
2025-06-13 10:29   ` Ahmad Fatoum
2025-06-13  7:58 ` [PATCH 7/7] ARM: MMU64: map text segment ro and data segments execute never Sascha Hauer
2025-06-13 10:40   ` Ahmad Fatoum
2025-06-13 12:44 ` Ahmad Fatoum [this message]

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=0ee3b17b-a544-4899-9cbf-3e01dc676510@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox