From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeyu@redhat.com (Jessica Yu) Date: Tue, 12 Jul 2016 20:11:14 -0400 Subject: [PATCH] arm64: take SHN_LIVEPATCH syms into account when calculating plt_max_entries In-Reply-To: References: <20160627151500.2247A68D20@newverein.lst.de> <20160627151722.B81C968D29@newverein.lst.de> <20160711215807.GA23097@packer-debian-8-amd64.digitalocean.com> Message-ID: <20160713001113.GA30925@packer-debian-8-amd64.digitalocean.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 --- 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