]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc/8xx: Fix initial memory mapping
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 20 Aug 2024 17:23:45 +0000 (19:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:29:10 +0000 (16:29 +0200)
commit6b7a006ab003ee01358c2f34ee0f9f2a5aa6b434
treeacdb0c854331aba932d8b9f62f9bf366616d1c71
parent415a2c218370c0e0f121133942daa36f0c17bb55
powerpc/8xx: Fix initial memory mapping

[ Upstream commit f9f2bff64c2f0dbee57be3d8c2741357ad3d05e6 ]

Commit cf209951fa7f ("powerpc/8xx: Map linear memory with huge pages")
introduced an initial mapping of kernel TEXT using PAGE_KERNEL_TEXT,
but the pages that contain kernel TEXT may also contain kernel RODATA,
and depending on selected debug options PAGE_KERNEL_TEXT may be either
RWX or ROX. RODATA must be writable during init because it also
contains ro_after_init data.

So use PAGE_KERNEL_X instead to be sure it is RWX.

Fixes: cf209951fa7f ("powerpc/8xx: Map linear memory with huge pages")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/dac7a828d8497c4548c91840575a706657baa4f1.1724173828.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/mm/nohash/8xx.c