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, Roman Gushchin <guro@fb.com>,
	Johannes Weiner <hannes@cmpxchg.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: [rgushchin:fix_vmstats 199/221] lib/strncpy_from_user.c:112:42: warning: passing argument 1 of 'untagged_addr' makes integer from pointer without a cast
Date: Tue, 13 Aug 2019 22:00:38 +0800	[thread overview]
Message-ID: <201908132234.dxi9IQrs%lkp@intel.com> (raw)

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

tree:   https://github.com/rgushchin/linux.git fix_vmstats
head:   4ec858b5201ae067607e82706b36588631c1b990
commit: f198eb8345ed9cef77b65d1c0edffba3fa3f6d2a [199/221] 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 f198eb8345ed9cef77b65d1c0edffba3fa3f6d2a
        # 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 warnings (new ones prefixed by >>):

   lib/strncpy_from_user.c: In function 'strncpy_from_user':
>> lib/strncpy_from_user.c:112:42: warning: passing argument 1 of 'untagged_addr' makes integer from pointer without a cast [-Wint-conversion]
     src_addr = (unsigned long)untagged_addr(src);
                                             ^~~
   In file included from arch/sparc/include/asm/pgtable.h:5:0,
                    from include/linux/mm.h:99,
                    from lib/strncpy_from_user.c:9:
   arch/sparc/include/asm/pgtable_64.h:1081:29: note: expected 'long unsigned int' but argument is of type 'const char *'
    static inline unsigned long untagged_addr(unsigned long start)
                                ^~~~~~~~~~~~~
--
   lib/strnlen_user.c: In function 'strnlen_user':
>> lib/strnlen_user.c:113:42: warning: passing argument 1 of 'untagged_addr' makes integer from pointer without a cast [-Wint-conversion]
     src_addr = (unsigned long)untagged_addr(str);
                                             ^~~
   In file included from arch/sparc/include/asm/pgtable.h:5:0,
                    from include/linux/mm.h:99,
                    from lib/strnlen_user.c:5:
   arch/sparc/include/asm/pgtable_64.h:1081:29: note: expected 'long unsigned int' but argument is of type 'const char *'
    static inline unsigned long untagged_addr(unsigned long start)
                                ^~~~~~~~~~~~~

vim +/untagged_addr +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);

---
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: 58699 bytes --]

             reply	other threads:[~2019-08-13 14:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 14:00 kbuild test robot [this message]
2019-08-13 16:01 ` [rgushchin:fix_vmstats 199/221] lib/strncpy_from_user.c:112:42: warning: passing argument 1 of 'untagged_addr' makes integer from pointer without a cast Andrey Konovalov

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=201908132234.dxi9IQrs%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --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).