All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kernel@openeuler.org, Zheng Zengkai <zhengzengkai@huawei.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [openeuler:OLK-5.10 2441/2441] mm/kasan/common.c:471:16: error: void value not ignored as it ought to be
Date: Sun, 1 Dec 2024 16:58:32 +0800	[thread overview]
Message-ID: <202412011647.JJxaTRfd-lkp@intel.com> (raw)

tree:   https://gitee.com/openeuler/kernel.git OLK-5.10
head:   a2b4d661a5ca59dd7cf972c1cce8b98422102ab7
commit: d5ddd7080c7442f22d6b92d6fed0dacc606013d1 [2441/2441] kasan: sanitize objects when metadata doesn't fit
config: arm64-randconfig-003-20241118 (https://download.01.org/0day-ci/archive/20241201/202412011647.JJxaTRfd-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241201/202412011647.JJxaTRfd-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412011647.JJxaTRfd-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from mm/kasan/common.c:40:
   mm/kasan/kasan.h: In function 'quarantine_put':
   mm/kasan/kasan.h:198:84: warning: 'return' with a value, in function returning void [-Wreturn-mismatch]
     198 | static inline void quarantine_put(struct kmem_cache *cache, void *object) { return false; }
         |                                                                                    ^~~~~
   mm/kasan/kasan.h:198:20: note: declared here
     198 | static inline void quarantine_put(struct kmem_cache *cache, void *object) { return false; }
         |                    ^~~~~~~~~~~~~~
   mm/kasan/common.c: In function '__kasan_slab_free':
>> mm/kasan/common.c:471:16: error: void value not ignored as it ought to be
     471 |         return quarantine_put(cache, object);
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/kasan/common.c:472:1: warning: control reaches end of non-void function [-Wreturn-type]
     472 | }
         | ^


vim +471 mm/kasan/common.c

   431	
   432	static bool __kasan_slab_free(struct kmem_cache *cache, void *object,
   433				      unsigned long ip, bool quarantine)
   434	{
   435		s8 shadow_byte;
   436		u8 tag;
   437		void *tagged_object;
   438		unsigned long rounded_up_size;
   439	
   440		tag = get_tag(object);
   441		tagged_object = object;
   442		object = reset_tag(object);
   443	
   444		if (is_kfence_address(object))
   445			return false;
   446	
   447		if (unlikely(nearest_obj(cache, virt_to_head_page(object), object) !=
   448		    object)) {
   449			kasan_report_invalid_free(tagged_object, ip);
   450			return true;
   451		}
   452	
   453		/* RCU slabs could be legally used after free within the RCU period */
   454		if (unlikely(cache->flags & SLAB_TYPESAFE_BY_RCU))
   455			return false;
   456	
   457		shadow_byte = READ_ONCE(*(s8 *)kasan_mem_to_shadow(object));
   458		if (shadow_invalid(tag, shadow_byte)) {
   459			kasan_report_invalid_free(tagged_object, ip);
   460			return true;
   461		}
   462	
   463		rounded_up_size = round_up(cache->object_size, KASAN_SHADOW_SCALE_SIZE);
   464		kasan_poison_shadow(object, rounded_up_size, KASAN_KMALLOC_FREE);
   465	
   466		if ((IS_ENABLED(CONFIG_KASAN_GENERIC) && !quarantine))
   467			return false;
   468	
   469		kasan_set_free_info(cache, object, tag);
   470	
 > 471		return quarantine_put(cache, object);
   472	}
   473	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2024-12-01  8:59 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=202412011647.JJxaTRfd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kernel@openeuler.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=zhengzengkai@huawei.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 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.