Content-Type: multipart/mixed; boundary="===============5222616664469641907==" MIME-Version: 1.0 From: Dan Carpenter To: kbuild-all@lists.01.org Subject: Re: [PATCH] vfio/mlx5: clean up overflow check Date: Tue, 12 Jul 2022 17:33:19 +0300 Message-ID: <20220712143318.GQ2338@kadam> In-Reply-To: <202207080331.FTVSHxW8-lkp@intel.com> List-Id: --===============5222616664469641907== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sorry for these! I need to resend, of course. I'm sligtly delayed because it was a three day weekend. I will try do that tomorrow. regards, dan carpenter On Fri, Jul 08, 2022 at 03:37:32AM +0800, kernel test robot wrote: > 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-202= 20707] > [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/202207= 08/202207080331.FTVSHxW8-lkp(a)intel.com/config) > compiler: gcc-11 (Debian 11.3.0-3) 11.3.0 > reproduce (this is a W=3D1 build): > # https://github.com/intel-lab-lkp/linux/commit/44607f8f3817e1af6= 622db7d70ad5bc457b8f203 > 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=3D1 O=3Dbuild_dir ARCH=3Di386 SHELL=3D/bin/bash drivers/vf= io/pci/mlx5/ > = > If you fix the issue, kindly add following tag where applicable > Reported-by: kernel test robot > = > 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 pointe= r types lacks a cast > 67 | (void) (&__a =3D=3D &__b); \ > | ^~ > drivers/vfio/pci/mlx5/main.c:282:13: note: in expansion of macro 'chec= k_add_overflow' > 282 | check_add_overflow(len, (unsigned long)*pos, &requ= ested_length)) > | ^~~~~~~~~~~~~~~~~~ > include/linux/overflow.h:68:22: warning: comparison of distinct pointe= r types lacks a cast > 68 | (void) (&__a =3D=3D __d); \ > | ^~ > drivers/vfio/pci/mlx5/main.c:282:13: note: in expansion of macro 'chec= k_add_overflow' > 282 | check_add_overflow(len, (unsigned long)*pos, &requ= ested_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 co= de hygiene, the fallback code below insists on > f0907827a8a9152 Rasmus Villemoes 2018-05-08 57 * a, b and *d having th= e 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. Henc= e we don't just make check_add_overflow an > f0907827a8a9152 Rasmus Villemoes 2018-05-08 60 * alias for __builtin_a= dd_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_overfl= ow(a, b, d) __must_check_overflow(({ \ > f0907827a8a9152 Rasmus Villemoes 2018-05-08 64 typeof(a) __a =3D (a); = \ > f0907827a8a9152 Rasmus Villemoes 2018-05-08 65 typeof(b) __b =3D (b); = \ > f0907827a8a9152 Rasmus Villemoes 2018-05-08 66 typeof(d) __d =3D (d); = \ > f0907827a8a9152 Rasmus Villemoes 2018-05-08 @67 (void) (&__a =3D=3D &__= b); \ > f0907827a8a9152 Rasmus Villemoes 2018-05-08 68 (void) (&__a =3D=3D __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 --===============5222616664469641907==--