Thread (23 messages) 23 messages, 8 authors, 2016-08-17
STALE3605d

[PATCH] arm64: take SHN_LIVEPATCH syms into account when calculating plt_max_entries

From: Jessica Yu <hidden>
Date: 2016-07-13 00:11:40
Also in: linux-arch, lkml
Subsystem: arm64 port (aarch64 architecture), the rest · Maintainers: Catalin Marinas, Will Deacon, Linus Torvalds

SHN_LIVEPATCH symbols are technically a subset of SHN_UNDEF/undefined
symbols, except that their addresses are resolved by livepatch at runtime.
Therefore, when calculating the upper-bound for the number of plt entries
to allocate, make sure to take livepatch symbols into account as well.

Signed-off-by: Jessica Yu <redacted>
---
 arch/arm64/kernel/module-plts.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/module-plts.c b/arch/arm64/kernel/module-plts.c
index 1ce90d8..1e95dc1 100644
--- a/arch/arm64/kernel/module-plts.c
+++ b/arch/arm64/kernel/module-plts.c
@@ -122,7 +122,8 @@ static unsigned int count_plts(Elf64_Sym *syms, Elf64_Rela *rela, int num)
                         * as well, so modules can never grow beyond that limit.
                         */
                        s = syms + ELF64_R_SYM(rela[i].r_info);
-                       if (s->st_shndx != SHN_UNDEF)
+                       if (s->st_shndx != SHN_UNDEF &&
+                           s->st_shndx != SHN_LIVEPATCH)
                                break;

                        /*
-- 
2.5.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help