linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andrey Konovalov <andreyknvl@google.com>
Cc: kbuild-all@lists.01.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [ambarus:saravana-fw-devlink-more-forgiving-v2 7805/7919] mm/kasan/shadow.c:87:14: warning: cast from pointer to integer of different size
Date: Wed, 3 Feb 2021 03:40:29 +0800	[thread overview]
Message-ID: <202102030327.Zdm7AcK4-lkp@intel.com> (raw)

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

tree:   https://github.com/ambarus/linux-0day saravana-fw-devlink-more-forgiving-v2
head:   2c330a32f492512c7e8683ce046c716ecec67681
commit: 9714985cbac3b3dfb9459578180f7256c482a21b [7805/7919] kasan: ensure poisoning size alignment
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.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://github.com/ambarus/linux-0day/commit/9714985cbac3b3dfb9459578180f7256c482a21b
        git remote add ambarus https://github.com/ambarus/linux-0day
        git fetch --no-tags ambarus saravana-fw-devlink-more-forgiving-v2
        git checkout 9714985cbac3b3dfb9459578180f7256c482a21b
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

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

All warnings (new ones prefixed by >>):

   In file included from arch/arm/include/asm/bug.h:60,
                    from include/linux/bug.h:5,
                    from include/linux/cpumask.h:14,
                    from include/linux/smp.h:13,
                    from arch/arm/include/asm/proc-fns.h:105,
                    from arch/arm/include/asm/pgtable.h:11,
                    from include/linux/pgtable.h:6,
                    from include/linux/kasan.h:28,
                    from mm/kasan/shadow.c:14:
   mm/kasan/shadow.c: In function 'kasan_poison':
>> mm/kasan/shadow.c:87:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      87 |  if (WARN_ON((u64)addr & KASAN_GRANULE_MASK))
         |              ^
   include/asm-generic/bug.h:119:25: note: in definition of macro 'WARN_ON'
     119 |  int __ret_warn_on = !!(condition);    \
         |                         ^~~~~~~~~
   mm/kasan/shadow.c: In function 'kasan_unpoison':
   mm/kasan/shadow.c:128:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     128 |  if (WARN_ON((u64)addr & KASAN_GRANULE_MASK))
         |              ^
   include/asm-generic/bug.h:119:25: note: in definition of macro 'WARN_ON'
     119 |  int __ret_warn_on = !!(condition);    \
         |                         ^~~~~~~~~


vim +87 mm/kasan/shadow.c

    71	
    72	void kasan_poison(const void *addr, size_t size, u8 value)
    73	{
    74		void *shadow_start, *shadow_end;
    75	
    76		/*
    77		 * Perform shadow offset calculation based on untagged address, as
    78		 * some of the callers (e.g. kasan_poison_object_data) pass tagged
    79		 * addresses to this function.
    80		 */
    81		addr = kasan_reset_tag(addr);
    82	
    83		/* Skip KFENCE memory if called explicitly outside of sl*b. */
    84		if (is_kfence_address(addr))
    85			return;
    86	
  > 87		if (WARN_ON((u64)addr & KASAN_GRANULE_MASK))
    88			return;
    89		if (WARN_ON(size & KASAN_GRANULE_MASK))
    90			return;
    91	
    92		shadow_start = kasan_mem_to_shadow(addr);
    93		shadow_end = kasan_mem_to_shadow(addr + size);
    94	
    95		__memset(shadow_start, value, shadow_end - shadow_start);
    96	}
    97	EXPORT_SYMBOL(kasan_poison);
    98	

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

                 reply	other threads:[~2021-02-02 19:41 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=202102030327.Zdm7AcK4-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.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 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).