public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel test robot <lkp@intel.com>
Cc: Dan Carpenter <error27@gmail.com>,
	Chuck Lever <chuck.lever@oracle.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	llvm@lists.linux.dev, kbuild-all@lists.01.org,
	Anna Schumaker <anna@kernel.org>,
	linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Subject: Re: [PATCH] NFSD: prevent integer overflow on 32 bit systems
Date: Tue, 15 Mar 2022 18:40:02 +0300	[thread overview]
Message-ID: <20220315154002.GO3293@kadam> (raw)
In-Reply-To: <202203150321.2NA8SWEv-lkp@intel.com>

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 constant 4611686018427387903 with expression of type '__u32' (aka 'unsigned int') 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


      reply	other threads:[~2022-03-15 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220314140958.GE30883@kili>
2022-03-14 19:57 ` [PATCH] NFSD: prevent integer overflow on 32 bit systems kernel test robot
2022-03-15 15:40   ` Dan Carpenter [this message]

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=20220315154002.GO3293@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=error27@gmail.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=trond.myklebust@hammerspace.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