Content-Type: multipart/mixed; boundary="===============1335426631441403589==" MIME-Version: 1.0 From: Dan Carpenter To: kbuild-all@lists.01.org Subject: Re: [PATCH] NFSD: prevent integer overflow on 32 bit systems Date: Tue, 15 Mar 2022 18:40:02 +0300 Message-ID: <20220315154002.GO3293@kadam> In-Reply-To: <202203150321.2NA8SWEv-lkp@intel.com> List-Id: --===============1335426631441403589== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Tue, Mar 15, 2022 at 03:57:36AM +0800, kernel test robot wrote: > In file included from net/ipv4/ipconfig.c:59: > In file included from include/linux/nfs_fs.h:31: > In file included from include/linux/sunrpc/auth.h:13: > In file included from include/linux/sunrpc/sched.h:19: > >> include/linux/sunrpc/xdr.h:734:10: warning: result of comparison of co= nstant 4611686018427387903 with expression of type '__u32' (aka 'unsigned i= nt') is always false [-Wtautological-constant-out-of-range-compare] > if (len > ULONG_MAX / sizeof(*p)) > ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~ Smatch also wanted to send this warning. I am testing a fix to silence this warning in Smatch. It looks for an some_int > some_expression where some_expression has ULONG_MAX on the far left hand side of the binop. Because the some_expression always starts with ULONG_MAX and then divides it and/or subtracts from it to get the max. regards, dan carpenter --===============1335426631441403589==--