lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202202171546.ctApx9Nj-lkp@intel.com>
Date:   Thu, 17 Feb 2022 15:46:51 +0800
From:   kernel test robot <lkp@...el.com>
To:     Yu-cheng Yu <yu-cheng.yu@...el.com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        Mike Rapoport <rppt@...nel.org>, linux-kernel@...r.kernel.org,
        Mike Rapoport <rppt@...ux.ibm.com>,
        Kees Cook <keescook@...omium.org>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Rick Edgecombe <rick.p.edgecombe@...el.com>
Subject: [rppt:cet/kvm 12/49] arch/x86/include/asm/pgtable.h:1312:13: error:
 invalid output size for constraint '+a'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git cet/kvm
head:   e2f9808bd7530f44cd5d95332036bb660b66b8db
commit: b20ff701175a81ee3517a5f2bca5bbac90529892 [12/49] x86/mm: Update ptep_set_wrprotect() and pmdp_set_wrprotect() for transition from _PAGE_DIRTY to _PAGE_COW
config: i386-randconfig-a006 (https://download.01.org/0day-ci/archive/20220217/202202171546.ctApx9Nj-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0bad7cb56526f2572c74449fcf97c1fcda42b41d)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/commit/?id=b20ff701175a81ee3517a5f2bca5bbac90529892
        git remote add rppt https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
        git fetch --no-tags rppt cet/kvm
        git checkout b20ff701175a81ee3517a5f2bca5bbac90529892
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 prepare

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:20:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
>> arch/x86/include/asm/pgtable.h:1312:13: error: invalid output size for constraint '+a'
                   } while (!try_cmpxchg(&ptep->pte, &old_pte.pte, new_pte.pte));
                             ^
   include/linux/atomic/atomic-instrumented.h:1978:2: note: expanded from macro 'try_cmpxchg'
           arch_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
           ^
   arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'arch_try_cmpxchg'
           __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
           ^
   arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro '__try_cmpxchg'
           __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
           ^
   arch/x86/include/asm/cmpxchg.h:172:23: note: expanded from macro '__raw_try_cmpxchg'
                                  [old] "+a" (__old)                       \
                                              ^
   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:20:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
>> arch/x86/include/asm/pgtable.h:1312:13: error: invalid output size for constraint '+a'
   include/linux/atomic/atomic-instrumented.h:1978:2: note: expanded from macro 'try_cmpxchg'
           arch_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
           ^
   arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'arch_try_cmpxchg'
           __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
           ^
   arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro '__try_cmpxchg'
           __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
           ^
   arch/x86/include/asm/cmpxchg.h:184:23: note: expanded from macro '__raw_try_cmpxchg'
                                  [old] "+a" (__old)                       \
                                              ^
   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:20:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
>> arch/x86/include/asm/pgtable.h:1312:13: error: invalid output size for constraint '+a'
   include/linux/atomic/atomic-instrumented.h:1978:2: note: expanded from macro 'try_cmpxchg'
           arch_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
           ^
   arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'arch_try_cmpxchg'
           __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
           ^
   arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro '__try_cmpxchg'
           __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
           ^
   arch/x86/include/asm/cmpxchg.h:196:23: note: expanded from macro '__raw_try_cmpxchg'
                                  [old] "+a" (__old)                       \
                                              ^
   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:20:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
>> arch/x86/include/asm/pgtable.h:1312:13: error: invalid output size for constraint '+a'
   include/linux/atomic/atomic-instrumented.h:1978:2: note: expanded from macro 'try_cmpxchg'
           arch_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
           ^
   arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'arch_try_cmpxchg'
           __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
           ^
   arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro '__try_cmpxchg'
           __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
           ^
   arch/x86/include/asm/cmpxchg.h:208:23: note: expanded from macro '__raw_try_cmpxchg'
                                  [old] "+a" (__old)                       \
                                              ^
   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:20:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
   arch/x86/include/asm/pgtable.h:1383:13: error: invalid output size for constraint '+a'
                   } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
                             ^
   include/linux/atomic/atomic-instrumented.h:1978:2: note: expanded from macro 'try_cmpxchg'
           arch_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
           ^
   arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'arch_try_cmpxchg'
           __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
           ^
   arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro '__try_cmpxchg'
           __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
           ^
   arch/x86/include/asm/cmpxchg.h:172:23: note: expanded from macro '__raw_try_cmpxchg'
                                  [old] "+a" (__old)                       \
                                              ^
   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:20:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
   arch/x86/include/asm/pgtable.h:1383:13: error: invalid output size for constraint '+a'
   include/linux/atomic/atomic-instrumented.h:1978:2: note: expanded from macro 'try_cmpxchg'
           arch_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
           ^
   arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'arch_try_cmpxchg'
           __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
           ^
   arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro '__try_cmpxchg'
           __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
           ^
   arch/x86/include/asm/cmpxchg.h:184:23: note: expanded from macro '__raw_try_cmpxchg'
                                  [old] "+a" (__old)                       \
                                              ^
   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:20:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
   arch/x86/include/asm/pgtable.h:1383:13: error: invalid output size for constraint '+a'
   include/linux/atomic/atomic-instrumented.h:1978:2: note: expanded from macro 'try_cmpxchg'
           arch_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
           ^
   arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'arch_try_cmpxchg'
           __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
           ^
   arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro '__try_cmpxchg'
           __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
           ^
   arch/x86/include/asm/cmpxchg.h:196:23: note: expanded from macro '__raw_try_cmpxchg'
                                  [old] "+a" (__old)                       \
                                              ^
   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:20:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
   arch/x86/include/asm/pgtable.h:1383:13: error: invalid output size for constraint '+a'
   include/linux/atomic/atomic-instrumented.h:1978:2: note: expanded from macro 'try_cmpxchg'
           arch_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
           ^
   arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'arch_try_cmpxchg'
           __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
           ^
   arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro '__try_cmpxchg'
           __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
           ^
   arch/x86/include/asm/cmpxchg.h:208:23: note: expanded from macro '__raw_try_cmpxchg'
                                  [old] "+a" (__old)                       \
                                              ^
   8 errors generated.
   make[2]: *** [scripts/Makefile.build:121: arch/x86/kernel/asm-offsets.s] Error 1
   make[2]: Target '__build' not remade because of errors.
   make[1]: *** [Makefile:1191: prepare0] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:219: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.


vim +1312 arch/x86/include/asm/pgtable.h

  1293	
  1294	#define __HAVE_ARCH_PTEP_SET_WRPROTECT
  1295	static inline void ptep_set_wrprotect(struct mm_struct *mm,
  1296					      unsigned long addr, pte_t *ptep)
  1297	{
  1298		/*
  1299		 * If Shadow Stack is enabled, pte_wrprotect() moves _PAGE_DIRTY
  1300		 * to _PAGE_COW (see comments at pte_wrprotect()).
  1301		 * When a thread reads a RW=1, Dirty=0 PTE and before changing it
  1302		 * to RW=0, Dirty=0, another thread could have written to the page
  1303		 * and the PTE is RW=1, Dirty=1 now.  Use try_cmpxchg() to detect
  1304		 * PTE changes and update old_pte, then try again.
  1305		 */
  1306		if (cpu_feature_enabled(X86_FEATURE_SHSTK)) {
  1307			pte_t old_pte, new_pte;
  1308	
  1309			old_pte = READ_ONCE(*ptep);
  1310			do {
  1311				new_pte = pte_wrprotect(old_pte);
> 1312			} while (!try_cmpxchg(&ptep->pte, &old_pte.pte, new_pte.pte));
  1313	
  1314			return;
  1315		}
  1316		clear_bit(_PAGE_BIT_RW, (unsigned long *)&ptep->pte);
  1317	}
  1318	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ