From: kernel test robot <lkp@intel.com>
To: Dan Carpenter <error27@gmail.com>, Jason Gunthorpe <jgg@ziepe.ca>
Cc: kbuild-all@lists.01.org, Yishai Hadas <yishaih@nvidia.com>,
Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>,
Kevin Tian <kevin.tian@intel.com>,
Alex Williamson <alex.williamson@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
Leon Romanovsky <leon@kernel.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] vfio/mlx5: clean up overflow check
Date: Fri, 8 Jul 2022 03:37:32 +0800 [thread overview]
Message-ID: <202207080331.FTVSHxW8-lkp@intel.com> (raw)
In-Reply-To: <YsbzgQQ4bg6v+iTS@kili>
Hi Dan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on awilliam-vfio/next]
[also build test WARNING on rdma/for-next linus/master v5.19-rc5 next-20220707]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Dan-Carpenter/vfio-mlx5-clean-up-overflow-check/20220707-225657
base: https://github.com/awilliam/linux-vfio.git next
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220708/202207080331.FTVSHxW8-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/44607f8f3817e1af6622db7d70ad5bc457b8f203
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Dan-Carpenter/vfio-mlx5-clean-up-overflow-check/20220707-225657
git checkout 44607f8f3817e1af6622db7d70ad5bc457b8f203
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/vfio/pci/mlx5/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/device.h:29,
from drivers/vfio/pci/mlx5/main.c:6:
drivers/vfio/pci/mlx5/main.c: In function 'mlx5vf_resume_write':
>> include/linux/overflow.h:67:22: warning: comparison of distinct pointer types lacks a cast
67 | (void) (&__a == &__b); \
| ^~
drivers/vfio/pci/mlx5/main.c:282:13: note: in expansion of macro 'check_add_overflow'
282 | check_add_overflow(len, (unsigned long)*pos, &requested_length))
| ^~~~~~~~~~~~~~~~~~
include/linux/overflow.h:68:22: warning: comparison of distinct pointer types lacks a cast
68 | (void) (&__a == __d); \
| ^~
drivers/vfio/pci/mlx5/main.c:282:13: note: in expansion of macro 'check_add_overflow'
282 | check_add_overflow(len, (unsigned long)*pos, &requested_length))
| ^~~~~~~~~~~~~~~~~~
vim +67 include/linux/overflow.h
9b80e4c4ddaca35 Kees Cook 2020-08-12 54
f0907827a8a9152 Rasmus Villemoes 2018-05-08 55 /*
f0907827a8a9152 Rasmus Villemoes 2018-05-08 56 * For simplicity and code hygiene, the fallback code below insists on
f0907827a8a9152 Rasmus Villemoes 2018-05-08 57 * a, b and *d having the same type (similar to the min() and max()
f0907827a8a9152 Rasmus Villemoes 2018-05-08 58 * macros), whereas gcc's type-generic overflow checkers accept
f0907827a8a9152 Rasmus Villemoes 2018-05-08 59 * different types. Hence we don't just make check_add_overflow an
f0907827a8a9152 Rasmus Villemoes 2018-05-08 60 * alias for __builtin_add_overflow, but add type checks similar to
f0907827a8a9152 Rasmus Villemoes 2018-05-08 61 * below.
f0907827a8a9152 Rasmus Villemoes 2018-05-08 62 */
9b80e4c4ddaca35 Kees Cook 2020-08-12 63 #define check_add_overflow(a, b, d) __must_check_overflow(({ \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 64 typeof(a) __a = (a); \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 65 typeof(b) __b = (b); \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 66 typeof(d) __d = (d); \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 @67 (void) (&__a == &__b); \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 68 (void) (&__a == __d); \
f0907827a8a9152 Rasmus Villemoes 2018-05-08 69 __builtin_add_overflow(__a, __b, __d); \
9b80e4c4ddaca35 Kees Cook 2020-08-12 70 }))
f0907827a8a9152 Rasmus Villemoes 2018-05-08 71
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next prev parent reply other threads:[~2022-07-07 19:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 14:53 [PATCH] vfio/mlx5: clean up overflow check Dan Carpenter
2022-07-07 19:37 ` kernel test robot [this message]
2022-07-12 14:33 ` Dan Carpenter
2022-07-12 6:00 ` kernel test robot
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=202207080331.FTVSHxW8-lkp@intel.com \
--to=lkp@intel.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=error27@gmail.com \
--cc=jgg@ziepe.ca \
--cc=kbuild-all@lists.01.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=yishaih@nvidia.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