Hi Thomas, I love your patch! Yet something to improve: [auto build test ERROR on tip/x86/core] [cannot apply to v5.4-rc7 next-20191111] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Thomas-Gleixner/x86-iopl-Prevent-user-space-from-using-CLI-STI-with-iopl-3/20191114-053418 base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 004e8dce9c5595697951f7cd0e9f66b35c92265e config: i386-tinyconfig (attached as .config) compiler: gcc-7 (Debian 7.4.0-14) 7.4.0 reproduce: # save the attached .config to linux build tree make ARCH=i386 If you fix the issue, kindly add following tag Reported-by: kbuild test robot Note: the linux-review/Thomas-Gleixner/x86-iopl-Prevent-user-space-from-using-CLI-STI-with-iopl-3/20191114-053418 HEAD b14095464382fae4bf55028eb1cebe0e3cc1b9c8 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): arch/x86/kernel/ioport.c: In function 'ksys_ioperm': >> arch/x86/kernel/ioport.c:83:7: error: 'struct tss_struct' has no member named 'io_bitmap_prev_max'; did you mean 'io_bitmap'? tss->io_bitmap_prev_max = bytes; ^~~~~~~~~~~~~~~~~~ io_bitmap vim +83 arch/x86/kernel/ioport.c 15 16 /* 17 * this changes the io permissions bitmap in the current task. 18 */ 19 long ksys_ioperm(unsigned long from, unsigned long num, int turn_on) 20 { 21 unsigned int i, max_long, bytes, bytes_updated; 22 struct thread_struct *t = ¤t->thread; 23 struct tss_struct *tss; 24 unsigned long *bitmap; 25 26 if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) 27 return -EINVAL; 28 if (turn_on && (!capable(CAP_SYS_RAWIO) || 29 security_locked_down(LOCKDOWN_IOPORT))) 30 return -EPERM; 31 32 /* 33 * If it's the first ioperm() call in this thread's lifetime, set the 34 * IO bitmap up. ioperm() is much less timing critical than clone(), 35 * this is why we delay this operation until now: 36 */ 37 bitmap = t->io_bitmap_ptr; 38 if (!bitmap) { 39 bitmap = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); 40 if (!bitmap) 41 return -ENOMEM; 42 43 memset(bitmap, 0xff, IO_BITMAP_BYTES); 44 } 45 46 /* 47 * Update the bitmap and the TSS copy with preemption disabled to 48 * prevent a race against context switch. 49 */ 50 preempt_disable(); 51 if (turn_on) 52 bitmap_clear(bitmap, from, num); 53 else 54 bitmap_set(bitmap, from, num); 55 56 /* 57 * Search for a (possibly new) maximum. This is simple and stupid, 58 * to keep it obviously correct: 59 */ 60 max_long = 0; 61 for (i = 0; i < IO_BITMAP_LONGS; i++) { 62 if (bitmap[i] != ~0UL) 63 max_long = i; 64 } 65 66 bytes = (max_long + 1) * sizeof(unsigned long); 67 bytes_updated = max(bytes, t->io_bitmap_max); 68 69 /* Update the thread data */ 70 t->io_bitmap_max = bytes; 71 /* 72 * Store the bitmap pointer (might be the same if the task already 73 * head one). Set the TIF flag, just in case this is the first 74 * invocation. 75 */ 76 t->io_bitmap_ptr = bitmap; 77 set_thread_flag(TIF_IO_BITMAP); 78 79 /* Update the TSS */ 80 tss = this_cpu_ptr(&cpu_tss_rw); 81 memcpy(tss->io_bitmap, t->io_bitmap_ptr, bytes_updated); 82 /* Store the new end of the zero bits */ > 83 tss->io_bitmap_prev_max = bytes; 84 /* Make sure the TSS limit covers the I/O bitmap. */ 85 refresh_tss_limit(); 86 87 preempt_enable(); 88 89 return 0; 90 } 91 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation