tree:
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git master
head: 7895d16159ceaf00aaec3790896a2a5851541ec2
commit: ce0bd4476f7816fe71b962d213bb3b180c66bf30 [14/16] Merge branch
'x86/module'
config: x86_64-rhel-7.6-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
#
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue master
git checkout ce0bd4476f7816fe71b962d213bb3b180c66bf30
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/x86/kernel/module.c: In function 'decode_module':
> arch/x86/kernel/module.c:485:3: error: implicit declaration of
function 'kernel_insn_init'; did you mean 'kernfs_init'?
[-Werror=implicit-function-declaration]
485 | kernel_insn_init(&insn,
text, text_end - text);
| ^~~~~~~~~~~~~~~~
| kernfs_init
In file included from arch/x86/include/asm/bug.h:93,
from include/linux/bug.h:5,
from include/linux/cpumask.h:14,
from arch/x86/include/asm/cpumask.h:5,
from arch/x86/include/asm/msr.h:11,
from arch/x86/include/asm/processor.h:22,
from arch/x86/include/asm/timex.h:5,
from include/linux/timex.h:65,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from include/linux/moduleloader.h:6,
from arch/x86/kernel/module.c:9:
> arch/x86/kernel/module.c:488:21: error: implicit declaration of
function 'insn_complete'; did you mean 'dpm_complete'?
[-Werror=implicit-function-declaration]
488 | if
(WARN_ON_ONCE(!insn_complete(&insn))) {
| ^~~~~~~~~~~~~
include/asm-generic/bug.h:102:25: note: in definition of macro 'WARN_ON_ONCE'
102 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
cc1: some warnings being treated as errors
vim +485 arch/x86/kernel/module.c
2c8b51426d7dcb Peter Zijlstra 2020-04-08 478
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 479 static int decode_module(struct module
*mod, void *text, void *text_end, bool sld_safe)
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 480 {
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 481 bool allow_vmx = sld_safe ||
!split_lock_enabled();
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 482 struct insn insn;
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 483
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 484 while (text < text_end) {
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 @485 kernel_insn_init(&insn, text,
text_end - text);
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 486 insn_get_length(&insn);
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 487
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 @488 if
(WARN_ON_ONCE(!insn_complete(&insn))) {
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 489 pr_err("Module text malformed:
%s\n", mod->name);
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 490 return -ENOEXEC;
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 491 }
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 492
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 493 if (!allow_vmx &&
insn_is_vmx(&insn)) {
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 494 pr_err("Module has VMX instructions
and is not marked 'sld_safe', boot with: 'split_lock_detect=off':
%s\n", mod->name);
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 495 return -ENOEXEC;
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 496 }
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 497
66b8cf79e55c95 Peter Zijlstra 2020-04-07 498 if (insn_is_special_reg(&insn)) {
66b8cf79e55c95 Peter Zijlstra 2020-04-07 499 pr_err("Module writes to CRn, XCRn
or DRn, please use the proper accessors: %s\n", mod->name);
66b8cf79e55c95 Peter Zijlstra 2020-04-07 500 return -ENOEXEC;
66b8cf79e55c95 Peter Zijlstra 2020-04-07 501 }
66b8cf79e55c95 Peter Zijlstra 2020-04-07 502
2c8b51426d7dcb Peter Zijlstra 2020-04-08 503 if (insn_is_GDT_modifier(&insn)) {
2c8b51426d7dcb Peter Zijlstra 2020-04-08 504 pr_err("Module tries to modify the
GDT, please use the proper accessors: %s\n", mod->name);
2c8b51426d7dcb Peter Zijlstra 2020-04-08 505 return -ENOEXEC;
2c8b51426d7dcb Peter Zijlstra 2020-04-08 506 }
2c8b51426d7dcb Peter Zijlstra 2020-04-08 507
2c8b51426d7dcb Peter Zijlstra 2020-04-08 508 if (insn_is_xRET(&insn)) {
2c8b51426d7dcb Peter Zijlstra 2020-04-08 509 pr_err("Module tries to return to
userspace: %s\n", mod->name);
2c8b51426d7dcb Peter Zijlstra 2020-04-08 510 return -ENOEXEC;
2c8b51426d7dcb Peter Zijlstra 2020-04-08 511 }
2c8b51426d7dcb Peter Zijlstra 2020-04-08 512
2c8b51426d7dcb Peter Zijlstra 2020-04-08 513 if (insn_is_XRSTOR(&insn)) {
2c8b51426d7dcb Peter Zijlstra 2020-04-08 514 pr_err("Module tries to muck with
register state: %s\n", mod->name);
2c8b51426d7dcb Peter Zijlstra 2020-04-08 515 return -ENOEXEC;
2c8b51426d7dcb Peter Zijlstra 2020-04-08 516 }
2c8b51426d7dcb Peter Zijlstra 2020-04-08 517
2c8b51426d7dcb Peter Zijlstra 2020-04-08 518 if (insn_is_FSGS(&insn)) {
2c8b51426d7dcb Peter Zijlstra 2020-04-08 519 pr_err("Module mucks with
FS/GS-base: %s\n", mod->name);
2c8b51426d7dcb Peter Zijlstra 2020-04-08 520 return -ENOEXEC;
2c8b51426d7dcb Peter Zijlstra 2020-04-08 521 }
2c8b51426d7dcb Peter Zijlstra 2020-04-08 522
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 523 text += insn.length;
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 524 }
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 525
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 526 return 0;
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 527 }
5fc97b3a93ac01 Peter Zijlstra 2020-04-02 528
:::::: The code at line 485 was first introduced by commit
:::::: 5fc97b3a93ac0160bfc9e5a3dcada67870d9aa29 x86,module: Detect VMX vs SLD conflicts
:::::: TO: Peter Zijlstra <peterz(a)infradead.org>
:::::: CC: Peter Zijlstra <peterz(a)infradead.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org