linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* mm/kasan/report.c:637 kasan_non_canonical_hook() warn: unsigned 'addr' is never less than zero.
@ 2023-11-27  0:25 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-11-27  0:25 UTC (permalink / raw)
  To: Haibo Li
  Cc: oe-kbuild-all, linux-kernel, Andrew Morton,
	Linux Memory Management List, Andrey Konovalov

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d2da77f431ac49b5763b88751a75f70daa46296c
commit: babddbfb7d7d70ae7f10fedd75a45d8ad75fdddf kasan: print the original fault addr when access invalid shadow
date:   6 weeks ago
config: loongarch-randconfig-r071-20231126 (https://download.01.org/0day-ci/archive/20231127/202311270743.3oTCwYPd-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231127/202311270743.3oTCwYPd-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/202311270743.3oTCwYPd-lkp@intel.com/

smatch warnings:
mm/kasan/report.c:637 kasan_non_canonical_hook() warn: unsigned 'addr' is never less than zero.

vim +/addr +637 mm/kasan/report.c

bb2f967ce2130b Andrey Konovalov 2022-03-24  623  
2f004eea0fc8f8 Jann Horn        2019-12-19  624  /*
babddbfb7d7d70 Haibo Li         2023-10-09  625   * With CONFIG_KASAN, accesses to bogus pointers (outside the high
2f004eea0fc8f8 Jann Horn        2019-12-19  626   * canonical half of the address space) cause out-of-bounds shadow memory reads
2f004eea0fc8f8 Jann Horn        2019-12-19  627   * before the actual access. For addresses in the low canonical half of the
2f004eea0fc8f8 Jann Horn        2019-12-19  628   * address space, as well as most non-canonical addresses, that out-of-bounds
2f004eea0fc8f8 Jann Horn        2019-12-19  629   * shadow memory access lands in the non-canonical part of the address space.
2f004eea0fc8f8 Jann Horn        2019-12-19  630   * Help the user figure out what the original bogus pointer was.
2f004eea0fc8f8 Jann Horn        2019-12-19  631   */
2f004eea0fc8f8 Jann Horn        2019-12-19  632  void kasan_non_canonical_hook(unsigned long addr)
2f004eea0fc8f8 Jann Horn        2019-12-19  633  {
2f004eea0fc8f8 Jann Horn        2019-12-19  634  	unsigned long orig_addr;
2f004eea0fc8f8 Jann Horn        2019-12-19  635  	const char *bug_type;
2f004eea0fc8f8 Jann Horn        2019-12-19  636  
2f004eea0fc8f8 Jann Horn        2019-12-19 @637  	if (addr < KASAN_SHADOW_OFFSET)

:::::: The code at line 637 was first introduced by commit
:::::: 2f004eea0fc8f86b45dfc2007add2d4986de8d02 x86/kasan: Print original address on #GP

:::::: TO: Jann Horn <jannh@google.com>
:::::: CC: Borislav Petkov <bp@suse.de>

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-27  0:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-27  0:25 mm/kasan/report.c:637 kasan_non_canonical_hook() warn: unsigned 'addr' is never less than zero kernel test robot

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).