Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 086377ed authored by Imran Khan's avatar Imran Khan
Browse files

arm64: Fix text patching logic



This patch makes the text patching logic aware of
flag CONFIG_KERNEL_TEXT_RDONLY. The upstream commit
'commit ef59ba11 ("UPSTREAM: arm64: Fix text
patching logic when using fixmap")' does not take
into account KERNEL_TEXT_RDONLY flag while patching
the text section.

CRs-Fixed: 1028648
Change-Id: I19172c60f735ccfda960b6a804bd9b57bb687843
Signed-off-by: default avatarImran Khan <kimran@codeaurora.org>
parent cc957303
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -87,7 +87,8 @@ static void __kprobes *patch_map(void *addr, int fixmap)

	if (module && IS_ENABLED(CONFIG_DEBUG_SET_MODULE_RONX))
		page = vmalloc_to_page(addr);
	else if (!module && IS_ENABLED(CONFIG_DEBUG_RODATA))
	else if (!module && (IS_ENABLED(CONFIG_DEBUG_RODATA) ||
			IS_ENABLED(CONFIG_KERNEL_TEXT_RDONLY)))
		page = virt_to_page(addr);
	else
		return addr;