tree: https://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git mce_copyin head: 722f462f54ac667ca8fbf3104ae5093d5b12aaf5 commit: 722f462f54ac667ca8fbf3104ae5093d5b12aaf5 [8/8] x86/mce: Decode a kernel instruction to determine if it is copying from user config: i386-randconfig-a005-20200908 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 reproduce (this is a W=1 build): git checkout 722f462f54ac667ca8fbf3104ae5093d5b12aaf5 # save the attached .config to linux build tree make W=1 ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All errors (new ones prefixed by >>): arch/x86/kernel/cpu/mce/severity.c: In function 'is_copy_from_user': >> arch/x86/kernel/cpu/mce/severity.c:204:14: error: 'MAX_INSN_SIZE' undeclared (first use in this function); did you mean 'MAX_UINSN_BYTES'? 204 | u8 insn_buf[MAX_INSN_SIZE]; | ^~~~~~~~~~~~~ | MAX_UINSN_BYTES arch/x86/kernel/cpu/mce/severity.c:204:14: note: each undeclared identifier is reported only once for each function it appears in >> arch/x86/kernel/cpu/mce/severity.c:205:14: error: storage size of 'insn' isn't known 205 | struct insn insn; | ^~~~ >> arch/x86/kernel/cpu/mce/severity.c:209:2: error: implicit declaration of function 'kernel_insn_init'; did you mean 'kernfs_init'? [-Werror=implicit-function-declaration] 209 | kernel_insn_init(&insn, insn_buf, MAX_INSN_SIZE); | ^~~~~~~~~~~~~~~~ | kernfs_init >> arch/x86/kernel/cpu/mce/severity.c:210:2: error: implicit declaration of function 'insn_get_length' [-Werror=implicit-function-declaration] 210 | insn_get_length(&insn); | ^~~~~~~~~~~~~~~ arch/x86/kernel/cpu/mce/severity.c:205:14: warning: unused variable 'insn' [-Wunused-variable] 205 | struct insn insn; | ^~~~ arch/x86/kernel/cpu/mce/severity.c:204:5: warning: unused variable 'insn_buf' [-Wunused-variable] 204 | u8 insn_buf[MAX_INSN_SIZE]; | ^~~~~~~~ cc1: some warnings being treated as errors # https://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git/commit/?id=722f462f54ac667ca8fbf3104ae5093d5b12aaf5 git remote add ia64 https://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git git fetch --no-tags ia64 mce_copyin git checkout 722f462f54ac667ca8fbf3104ae5093d5b12aaf5 vim +204 arch/x86/kernel/cpu/mce/severity.c 198 199 #define mc_recoverable(mcg) (((mcg) & (MCG_STATUS_RIPV|MCG_STATUS_EIPV)) == \ 200 (MCG_STATUS_RIPV|MCG_STATUS_EIPV)) 201 202 static bool is_copy_from_user(struct pt_regs *regs) 203 { > 204 u8 insn_buf[MAX_INSN_SIZE]; > 205 struct insn insn; 206 207 if (copy_from_kernel_nofault(insn_buf, (void *)regs->ip, MAX_INSN_SIZE)) 208 return false; > 209 kernel_insn_init(&insn, insn_buf, MAX_INSN_SIZE); > 210 insn_get_length(&insn); 211 212 switch (insn.opcode.value) { 213 case 0x8A: case 0x8B: /* MOV */ 214 case 0xB60F: case 0xB70F: /* MOVZ */ 215 return true; 216 case 0xA4: case 0xA5: /* MOVS */ 217 return !fault_in_kernel_space(regs->si); 218 } 219 220 return false; 221 } 222 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip