--- zzzz-none-000/linux-5.4.213/arch/arm/kernel/module-plts.c 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/arch/arm/kernel/module-plts.c 2024-08-14 09:01:27.000000000 +0000 @@ -12,6 +12,8 @@ #include #include +#include + #ifdef CONFIG_THUMB2_KERNEL #define PLT_ENT_LDR __opcode_to_mem_thumb32(0xf8dff000 | \ (PLT_ENT_STRIDE - 4)) @@ -84,7 +86,10 @@ } pltsec->plt_count++; - BUG_ON(pltsec->plt_count * PLT_ENT_SIZE > pltsec->plt->sh_size); + + if (!avm_module_is_allowed(mod->name)) { + BUG_ON(pltsec->plt_count * PLT_ENT_SIZE > pltsec->plt->sh_size); + } if (!idx) /* Populate a new set of entries */ @@ -263,6 +268,11 @@ numrels, s->sh_info); } + if (avm_module_is_allowed(mod->name)) { + pr_debug("[%s] no plts needed for core of module %s\n", __func__, mod->name); + core_plts = 0; + } + mod->arch.core.plt->sh_type = SHT_NOBITS; mod->arch.core.plt->sh_flags = SHF_EXECINSTR | SHF_ALLOC; mod->arch.core.plt->sh_addralign = L1_CACHE_BYTES;