[PATCH] arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y

Catalin Marinas catalin.marinas at arm.com
Wed Nov 22 10:52:40 PST 2023


On Fri, Nov 17, 2023 at 01:14:22PM +0000, Will Deacon wrote:
> When CONFIG_RODATA_FULL_DEFAULT_ENABLED=y, passing "rodata=on" on the
> kernel command-line (rather than "rodata=full") should turn off the
> "full" behaviour, leaving writable linear aliases of read-only kernel
> memory. Unfortunately, the option has no effect in this situation and
> the only way to disable the "rodata=full" behaviour is to disable rodata
> protection entirely by passing "rodata=off".
> 
> Fix this by parsing the "on" and "off" options in the arch code,
> additionally enforcing that 'rodata_full' cannot be set without also
> setting 'rodata_enabled', allowing us to simplify a couple of checks
> in the process.
> 
> Cc: Ard Biesheuvel <ardb at kernel.org>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Mark Rutland <mark.rutland at arm.com>
> Signed-off-by: Will Deacon <will at kernel.org>

I'll add a:

Fixes: 2e8cff0a0eee ("arm64: fix rodata=full")

My quick grep shows that rodata_full = false was removed by the above
commit, leaving the default set by the config option.

-- 
Catalin



More information about the linux-arm-kernel mailing list