[linux-next:master 13874/13946] lib/strncpy_from_user.c:112:46: error: expected ')' before ';' token

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

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: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux