linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Andrey Konovalov <andreyknvl@google.com>
Cc: kbuild-all@01.org, Mark Brown <broonie@kernel.org>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Khalid Aziz <khalid.aziz@oracle.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 13874/13946] lib/strncpy_from_user.c:112:46: error: expected ')' before ';' token
Date: Thu, 26 Sep 2019 21:51:43 +0800	[thread overview]
Message-ID: <201909262139.uBz4ids5%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d47175169c28eedd2cc2ab8c01f38764cb0269cc
commit: f672e2c217e2d4b2e8fa6568f8d7f49e9dd2b8e6 [13874/13946] lib: untag user pointers in strn*_user
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout f672e2c217e2d4b2e8fa6568f8d7f49e9dd2b8e6
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   mm/gup.c: In function '__get_user_pages_fast':
>> mm/gup.c:2321:42: error: expected ')' before ';' token
     start = untagged_addr(start) & PAGE_MASK;
                                             ^
>> mm/gup.c:2350:1: error: expected ';' before '}' token
    }
    ^
   mm/gup.c:2319:6: warning: unused variable 'nr' [-Wunused-variable]
     int nr = 0;
         ^~
   mm/gup.c:2318:16: warning: unused variable 'flags' [-Wunused-variable]
     unsigned long flags;
                   ^~~~~
   mm/gup.c:2317:21: warning: unused variable 'end' [-Wunused-variable]
     unsigned long len, end;
                        ^~~
   mm/gup.c:2317:16: warning: unused variable 'len' [-Wunused-variable]
     unsigned long len, end;
                   ^~~
   mm/gup.c: In function 'get_user_pages_fast':
   mm/gup.c:2401:42: error: expected ')' before ';' token
     start = untagged_addr(start) & PAGE_MASK;
                                             ^
   mm/gup.c:2437:1: error: expected ';' before '}' token
    }
    ^
   mm/gup.c:2396:14: warning: unused variable 'ret' [-Wunused-variable]
     int nr = 0, ret = 0;
                 ^~~
   mm/gup.c:2396:6: warning: unused variable 'nr' [-Wunused-variable]
     int nr = 0, ret = 0;
         ^~
   mm/gup.c:2395:27: warning: unused variable 'end' [-Wunused-variable]
     unsigned long addr, len, end;
                              ^~~
   mm/gup.c:2395:22: warning: unused variable 'len' [-Wunused-variable]
     unsigned long addr, len, end;
                         ^~~
   mm/gup.c:2395:16: warning: unused variable 'addr' [-Wunused-variable]
     unsigned long addr, len, end;
                   ^~~~
   mm/gup.c: In function '__get_user_pages_fast':
>> mm/gup.c:2350:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
   mm/gup.c: In function 'get_user_pages_fast':
   mm/gup.c:2437:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
   At top level:
   mm/gup.c:2353:12: warning: '__gup_longterm_unlocked' defined but not used [-Wunused-function]
    static int __gup_longterm_unlocked(unsigned long start, int nr_pages,
               ^~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:2299:13: warning: 'gup_fast_permitted' defined but not used [-Wunused-function]
    static bool gup_fast_permitted(unsigned long start, unsigned long end)
                ^~~~~~~~~~~~~~~~~~
   mm/gup.c:2262:13: warning: 'gup_pgd_range' defined but not used [-Wunused-function]
    static void gup_pgd_range(unsigned long addr, unsigned long end,
                ^~~~~~~~~~~~~
--
   lib/strncpy_from_user.c: In function 'strncpy_from_user':
>> lib/strncpy_from_user.c:112:46: error: expected ')' before ';' token
     src_addr = (unsigned long)untagged_addr(src);
                                                 ^
>> lib/strncpy_from_user.c:126:1: error: expected ';' before '}' token
    }
    ^
>> lib/strncpy_from_user.c:126:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
--
   lib/strnlen_user.c: In function 'strnlen_user':
>> lib/strnlen_user.c:113:46: error: expected ')' before ';' token
     src_addr = (unsigned long)untagged_addr(str);
                                                 ^
>> lib/strnlen_user.c:125:1: error: expected ';' before '}' token
    }
    ^
>> lib/strnlen_user.c:125:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +112 lib/strncpy_from_user.c

    85	
    86	/**
    87	 * strncpy_from_user: - Copy a NUL terminated string from userspace.
    88	 * @dst:   Destination address, in kernel space.  This buffer must be at
    89	 *         least @count bytes long.
    90	 * @src:   Source address, in user space.
    91	 * @count: Maximum number of bytes to copy, including the trailing NUL.
    92	 *
    93	 * Copies a NUL-terminated string from userspace to kernel space.
    94	 *
    95	 * On success, returns the length of the string (not including the trailing
    96	 * NUL).
    97	 *
    98	 * If access to userspace fails, returns -EFAULT (some data may have been
    99	 * copied).
   100	 *
   101	 * If @count is smaller than the length of the string, copies @count bytes
   102	 * and returns @count.
   103	 */
   104	long strncpy_from_user(char *dst, const char __user *src, long count)
   105	{
   106		unsigned long max_addr, src_addr;
   107	
   108		if (unlikely(count <= 0))
   109			return 0;
   110	
   111		max_addr = user_addr_max();
 > 112		src_addr = (unsigned long)untagged_addr(src);
   113		if (likely(src_addr < max_addr)) {
   114			unsigned long max = max_addr - src_addr;
   115			long retval;
   116	
   117			kasan_check_write(dst, count);
   118			check_object_size(dst, count, false);
   119			if (user_access_begin(src, max)) {
   120				retval = do_strncpy_from_user(dst, src, count, max);
   121				user_access_end();
   122				return retval;
   123			}
   124		}
   125		return -EFAULT;
 > 126	}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

                 reply	other threads:[~2019-09-26 13:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201909262139.uBz4ids5%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=kbuild-all@01.org \
    --cc=khalid.aziz@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=vincenzo.frascino@arm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).