From: kernel test robot <lkp@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [jgunthorpe:iommufd 7/13] include/linux/overflow.h:66:22: warning: comparison of distinct pointer types lacks a cast
Date: Wed, 13 Apr 2022 20:10:39 +0800 [thread overview]
Message-ID: <202204132034.dp2f42wp-lkp@intel.com> (raw)
tree: https://github.com/jgunthorpe/linux iommufd
head: fc388f906088fe5f5f2db6a36931e00124f52042
commit: 1af524ce30ddf820ec974c8635d3299caefc72ed [7/13] iommufd: Data structure to provide IOVA to PFN mapping
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220413/202204132034.dp2f42wp-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.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/jgunthorpe/linux/commit/1af524ce30ddf820ec974c8635d3299caefc72ed
git remote add jgunthorpe https://github.com/jgunthorpe/linux
git fetch --no-tags jgunthorpe iommufd
git checkout 1af524ce30ddf820ec974c8635d3299caefc72ed
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/iommu/iommufd/
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/arc/include/asm/bug.h:30,
from include/linux/bug.h:5,
from include/linux/cpumask.h:14,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from drivers/iommu/iommufd/io_pagetable.c:11:
drivers/iommu/iommufd/io_pagetable.c: In function 'iopt_unaccess_pages':
>> include/linux/overflow.h:66:22: warning: comparison of distinct pointer types lacks a cast
66 | (void) (&__a == &__b); \
| ^~
include/asm-generic/bug.h:121:32: note: in definition of macro 'WARN_ON'
121 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
drivers/iommu/iommufd/io_pagetable.c:486:21: note: in expansion of macro 'check_add_overflow'
486 | WARN_ON(check_add_overflow(iova, length - 1, &last_iova)))
| ^~~~~~~~~~~~~~~~~~
vim +66 include/linux/overflow.h
9b80e4c4ddaca35 Kees Cook 2020-08-12 53
f0907827a8a9152 Rasmus Villemoes 2018-05-08 54 /*
f0907827a8a9152 Rasmus Villemoes 2018-05-08 55 * For simplicity and code hygiene, the fallback code below insists on
f0907827a8a9152 Rasmus Villemoes 2018-05-08 56 * a, b and *d having the same type (similar to the min() and max()
f0907827a8a9152 Rasmus Villemoes 2018-05-08 57 * macros), whereas gcc's type-generic overflow checkers accept
f0907827a8a9152 Rasmus Villemoes 2018-05-08 58 * different types. Hence we don't just make check_add_overflow an
f0907827a8a9152 Rasmus Villemoes 2018-05-08 59 * alias for __builtin_add_overflow, but add type checks similar to
f0907827a8a9152 Rasmus Villemoes 2018-05-08 60 * below.
f0907827a8a9152 Rasmus Villemoes 2018-05-08 61 */
9b80e4c4ddaca35 Kees Cook 2020-08-12 62 #define check_add_overflow(a, b, d) __must_check_overflow(({ \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 63 typeof(a) __a = (a); \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 64 typeof(b) __b = (b); \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 65 typeof(d) __d = (d); \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 @66 (void) (&__a == &__b); \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 67 (void) (&__a == __d); \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 68 __builtin_add_overflow(__a, __b, __d); \
9b80e4c4ddaca35 Kees Cook 2020-08-12 69 }))
f0907827a8a9152 Rasmus Villemoes 2018-05-08 70
:::::: The code at line 66 was first introduced by commit
:::::: f0907827a8a9152aedac2833ed1b674a7b2a44f2 compiler.h: enable builtin overflow checkers and add fallback code
:::::: TO: Rasmus Villemoes <linux@rasmusvillemoes.dk>
:::::: CC: Kees Cook <keescook@chromium.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-04-13 12:11 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=202204132034.dp2f42wp-lkp@intel.com \
--to=lkp@intel.com \
--cc=jgg@nvidia.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.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 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.