All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: kbuild-all@lists.01.org, linux-arch@vger.kernel.org
Subject: [asm-generic:asm-generic-uaccess-5 1/9] arch/csky/lib/usercopy.c:221:17: error: 'src' undeclared
Date: Thu, 22 Jul 2021 21:26:46 +0800	[thread overview]
Message-ID: <202107222142.qPL2puxJ-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4261 bytes --]

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@intel.com>

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@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 10397 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [asm-generic:asm-generic-uaccess-5 1/9] arch/csky/lib/usercopy.c:221:17: error: 'src' undeclared
Date: Thu, 22 Jul 2021 21:26:46 +0800	[thread overview]
Message-ID: <202107222142.qPL2puxJ-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4359 bytes --]

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@intel.com>

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(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 10397 bytes --]

             reply	other threads:[~2021-07-22 13:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 13:26 kernel test robot [this message]
2021-07-22 13:26 ` [asm-generic:asm-generic-uaccess-5 1/9] arch/csky/lib/usercopy.c:221:17: error: 'src' undeclared kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202107222142.qPL2puxJ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@arndb.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arch@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.