From: Peng Hao <richard.peng@oppo.com>
To: catalin.marinas@arm.com, will@kernel.org
Cc: Peng Hao <richard.peng@oppo.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64/module-plts: Consider the special case where plt_max_entries is 0
Date: Tue, 7 Jul 2020 07:46:08 -0400 [thread overview]
Message-ID: <20200707114608.24197-1-richard.peng@oppo.com> (raw)
If plt_max_entries is 0, a warning is triggered.
WARNING: CPU: 200 PID: 3000 at arch/arm64/kernel/module-plts.c:97 module_emit_plt_entry+0xa4/0x150
Signed-off-by: Peng Hao <richard.peng@oppo.com>
---
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 65b08a74aec6..1868c9ac13f2 100644
--- a/arch/arm64/kernel/module-plts.c
+++ b/arch/arm64/kernel/module-plts.c
@@ -79,7 +79,8 @@ u64 module_emit_plt_entry(struct module *mod, Elf64_Shdr *sechdrs,
int i = pltsec->plt_num_entries;
int j = i - 1;
u64 val = sym->st_value + rela->r_addend;
-
+ if (pltsec->plt_max_entries == 0)
+ return 0;
if (is_forbidden_offset_for_adrp(&plt[i].adrp))
i++;
--
2.18.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-07-07 11:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-07 11:46 Peng Hao [this message]
2020-07-08 8:25 ` [PATCH] arm64/module-plts: Consider the special case where plt_max_entries is 0 Will Deacon
2020-07-08 8:48 ` Ard Biesheuvel
[not found] <HKAPR02MB4291B970192A023778445B1BE0670@HKAPR02MB4291.apcprd02.prod.outlook.com>
2020-07-08 12:19 ` Ard Biesheuvel
[not found] <HKAPR02MB42915BECBD71F5ABA0890533E0640@HKAPR02MB4291.apcprd02.prod.outlook.com>
2020-07-09 6:55 ` Ard Biesheuvel
[not found] <HKAPR02MB429186AF5DC0A187A345F3BCE0640@HKAPR02MB4291.apcprd02.prod.outlook.com>
2020-07-09 7:31 ` Will Deacon
[not found] <HKAPR02MB4291648701A6803290A17299E0610@HKAPR02MB4291.apcprd02.prod.outlook.com>
2020-08-21 11:17 ` Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200707114608.24197-1-richard.peng@oppo.com \
--to=richard.peng@oppo.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox