Hi Peter, Thank you for the patch! Yet something to improve: [auto build test ERROR on akpm-mm/mm-everything] url: https://github.com/intel-lab-lkp/linux/commits/Peter-Xu/mm-migrate-Fix-writable-pte-for-read-migration-entry/20221111-043302 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20221110203132.1498183-3-peterx%40redhat.com patch subject: [PATCH v2 2/2] mm/uffd: Sanity check write bit for uffd-wp protected ptes config: x86_64-randconfig-a012 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) 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://github.com/intel-lab-lkp/linux/commit/b103eae2926a263a15e262611524ca9efa8b969e git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Peter-Xu/mm-migrate-Fix-writable-pte-for-read-migration-entry/20221111-043302 git checkout b103eae2926a263a15e262611524ca9efa8b969e # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): In file included from arch/x86/kernel/early_printk.c:11: In file included from include/linux/pgtable.h:6: >> arch/x86/include/asm/pgtable.h:306:2: error: implicit declaration of function 'VM_WARN_ON_ONCE' is invalid in C99 [-Werror,-Wimplicit-function-declaration] VM_WARN_ON_ONCE(wp && pte_write(pte)); ^ 1 error generated. vim +/VM_WARN_ON_ONCE +306 arch/x86/include/asm/pgtable.h 290 291 #ifdef CONFIG_HAVE_ARCH_USERFAULTFD_WP 292 static inline int pte_uffd_wp(pte_t pte) 293 { 294 bool wp = pte_flags(pte) & _PAGE_UFFD_WP; 295 296 /* 297 * Having write bit for wr-protect-marked present ptes is fatal, 298 * because it means the uffd-wp bit will be ignored and write will 299 * just go through. 300 * 301 * Use any chance of pgtable walking to verify this (e.g., when 302 * page swapped out or being migrated for all purposes). It means 303 * something is already wrong. Tell the admin even before the 304 * process crashes. We also nail it with wrong pgtable setup. 305 */ > 306 VM_WARN_ON_ONCE(wp && pte_write(pte)); 307 308 return wp; 309 } 310 -- 0-DAY CI Kernel Test Service https://01.org/lkp