[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210181212.09j9oah4-lkp@intel.com>
Date: Tue, 18 Oct 2022 12:59:30 +0800
From: kernel test robot <lkp@...el.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [peterz-queue:x86/fineibt 62/62] arch/x86/um/../kernel/module.c:308:
undefined reference to `apply_fineibt'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/fineibt
head: ad50fd37eb1b4cca1cd54a4dd7effd6188e07507
commit: ad50fd37eb1b4cca1cd54a4dd7effd6188e07507 [62/62] x86/ibt: Implement FineIBT
config: um-i386_defconfig
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=ad50fd37eb1b4cca1cd54a4dd7effd6188e07507
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue x86/fineibt
git checkout ad50fd37eb1b4cca1cd54a4dd7effd6188e07507
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
/usr/bin/ld: warning: arch/x86/um/checksum_32.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: warning: .tmp_vmlinux.kallsyms1 has a LOAD segment with RWX permissions
/usr/bin/ld: arch/x86/kernel/module.o: in function `module_finalize':
>> arch/x86/um/../kernel/module.c:308: undefined reference to `apply_fineibt'
collect2: error: ld returned 1 exit status
vim +308 arch/x86/um/../kernel/module.c
250
251 int module_finalize(const Elf_Ehdr *hdr,
252 const Elf_Shdr *sechdrs,
253 struct module *me)
254 {
255 const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL,
256 *para = NULL, *orc = NULL, *orc_ip = NULL,
257 *retpolines = NULL, *returns = NULL, *ibt_endbr = NULL,
258 *calls = NULL, *cfi = NULL;
259 char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
260
261 for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) {
262 if (!strcmp(".text", secstrings + s->sh_name))
263 text = s;
264 if (!strcmp(".altinstructions", secstrings + s->sh_name))
265 alt = s;
266 if (!strcmp(".smp_locks", secstrings + s->sh_name))
267 locks = s;
268 if (!strcmp(".parainstructions", secstrings + s->sh_name))
269 para = s;
270 if (!strcmp(".orc_unwind", secstrings + s->sh_name))
271 orc = s;
272 if (!strcmp(".orc_unwind_ip", secstrings + s->sh_name))
273 orc_ip = s;
274 if (!strcmp(".retpoline_sites", secstrings + s->sh_name))
275 retpolines = s;
276 if (!strcmp(".return_sites", secstrings + s->sh_name))
277 returns = s;
278 if (!strcmp(".call_sites", secstrings + s->sh_name))
279 calls = s;
280 if (!strcmp(".cfi_sites", secstrings + s->sh_name))
281 cfi = s;
282 if (!strcmp(".ibt_endbr_seal", secstrings + s->sh_name))
283 ibt_endbr = s;
284 }
285
286 /*
287 * See alternative_instructions() for the ordering rules between the
288 * various patching types.
289 */
290 if (para) {
291 void *pseg = (void *)para->sh_addr;
292 apply_paravirt(pseg, pseg + para->sh_size);
293 }
294 if (retpolines || cfi) {
295 void *rseg = NULL, *cseg = NULL;
296 unsigned int rsize = 0, csize = 0;
297
298 if (retpolines) {
299 rseg = (void *)retpolines->sh_addr;
300 rsize = retpolines->sh_size;
301 }
302
303 if (cfi) {
304 cseg = (void *)cfi->sh_addr;
305 csize = cfi->sh_size;
306 }
307
> 308 apply_fineibt(rseg, rseg + rsize, cseg, cseg + csize);
309 }
310 if (retpolines) {
311 void *rseg = (void *)retpolines->sh_addr;
312 apply_retpolines(rseg, rseg + retpolines->sh_size);
313 }
314 if (returns) {
315 void *rseg = (void *)returns->sh_addr;
316 apply_returns(rseg, rseg + returns->sh_size);
317 }
318 if (alt) {
319 /* patch .altinstructions */
320 void *aseg = (void *)alt->sh_addr;
321 apply_alternatives(aseg, aseg + alt->sh_size);
322 }
323 if (calls || para) {
324 struct callthunk_sites cs = {};
325
326 if (calls) {
327 cs.call_start = (void *)calls->sh_addr;
328 cs.call_end = (void *)calls->sh_addr + calls->sh_size;
329 }
330
331 if (para) {
332 cs.pv_start = (void *)para->sh_addr;
333 cs.pv_end = (void *)para->sh_addr + para->sh_size;
334 }
335
336 callthunks_patch_module_calls(&cs, me);
337 }
338 if (ibt_endbr) {
339 void *iseg = (void *)ibt_endbr->sh_addr;
340 apply_ibt_endbr(iseg, iseg + ibt_endbr->sh_size);
341 }
342 if (locks && text) {
343 void *lseg = (void *)locks->sh_addr;
344 void *tseg = (void *)text->sh_addr;
345 alternatives_smp_module_add(me, me->name,
346 lseg, lseg + locks->sh_size,
347 tseg, tseg + text->sh_size);
348 }
349
350 if (orc && orc_ip)
351 unwind_module_init(me, (void *)orc_ip->sh_addr, orc_ip->sh_size,
352 (void *)orc->sh_addr, orc->sh_size);
353
354 return 0;
355 }
356
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (42284 bytes)
Powered by blists - more mailing lists