[PATCH v2 05/10] s390/module: Serialize text patching with text_mutex

From: Heiko Carstens

Date: Tue Oct 27 2026 - 10:37:01 EST


Acquire text_mutex in apply_relocate_add() in order to serialize text
patching.

This is part of larger series where at the end s390_kernel_write()
requires that callers hold text_mutex for serialization.

Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
---
arch/s390/kernel/module.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
index 9d1f8a50f5a4..79bc80d7bd02 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
@@ -462,6 +462,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
if (!early)
write = s390_kernel_write;

+ guard(mutex)(&text_mutex);
return __apply_relocate_add(sechdrs, strtab, symindex, relsec, me,
write);
}
--
2.53.0