tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git asm-generic-uaccess-5 head: 569f7cb1d4f50aa497092e533d9d4044f5a87b58 commit: 3a68cb1dbf65aa5c86ae185e5c51c5c26c31a54a [1/9] asm-generic/uaccess.h: remove __strncpy_from_user/__strnlen_user config: csky-defconfig (attached as .config) compiler: csky-linux-gcc (GCC) 10.3.0 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/arnd/asm-generic.git/commit/?id=3a68cb1dbf65aa5c86ae185e5c51c5c26c31a54a git remote add asm-generic https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git git fetch --no-tags asm-generic asm-generic-uaccess-5 git checkout 3a68cb1dbf65aa5c86ae185e5c51c5c26c31a54a # save the attached .config to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=csky SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> Note: the asm-generic/asm-generic-uaccess-5 HEAD 569f7cb1d4f50aa497092e533d9d4044f5a87b58 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): In file included from arch/csky/include/asm/uaccess.h:219, from include/linux/uaccess.h:11, from arch/csky/lib/usercopy.c:4: arch/csky/lib/usercopy.c: In function 'strnlen_user': >> arch/csky/lib/usercopy.c:221:17: error: 'src' undeclared (first use in this function) 221 | if (!access_ok(src, 1)) | ^~~ include/asm-generic/uaccess.h:124:59: note: in definition of macro 'access_ok' 124 | #define access_ok(addr, size) __access_ok((unsigned long)(addr),(size)) | ^~~~ arch/csky/lib/usercopy.c:221:17: note: each undeclared identifier is reported only once for each function it appears in 221 | if (!access_ok(src, 1)) | ^~~ include/asm-generic/uaccess.h:124:59: note: in definition of macro 'access_ok' 124 | #define access_ok(addr, size) __access_ok((unsigned long)(addr),(size)) | ^~~~ vim +/src +221 arch/csky/lib/usercopy.c 205 206 /* 207 * strnlen_user: - Get the size of a string in user space. 208 * @str: The string to measure. 209 * @n: The maximum valid length 210 * 211 * Get the size of a NUL-terminated string in user space. 212 * 213 * Returns the size of the string INCLUDING the terminating NUL. 214 * On exception, returns 0. 215 * If the string is too long, returns a value greater than @n. 216 */ 217 long strnlen_user(const char *s, long n) 218 { 219 unsigned long res, tmp; 220 > 221 if (!access_ok(src, 1)) 222 return -EFAULT; 223 224 __asm__ __volatile__( 225 " cmpnei %1, 0 \n" 226 " bf 3f \n" 227 "1: cmpnei %0, 0 \n" 228 " bf 3f \n" 229 "2: ldb %3, (%1, 0) \n" 230 " cmpnei %3, 0 \n" 231 " bf 3f \n" 232 " subi %0, 1 \n" 233 " addi %1, 1 \n" 234 " br 1b \n" 235 "3: subu %2, %0 \n" 236 " addi %2, 1 \n" 237 " br 5f \n" 238 "4: movi %0, 0 \n" 239 " br 5f \n" 240 ".section __ex_table, \"a\" \n" 241 ".align 2 \n" 242 ".long 2b, 4b \n" 243 ".previous \n" 244 "5: \n" 245 : "=r"(n), "=r"(s), "=r"(res), "=r"(tmp) 246 : "0"(n), "1"(s), "2"(n) 247 : "memory"); 248 249 return res; 250 } 251 EXPORT_SYMBOL(strnlen_user); 252 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip