public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] IB/core: type promotion bug in rdma_rw_init_one_mr()
Date: Wed, 04 Jul 2018 18:05:18 +0000	[thread overview]
Message-ID: <20180704180518.GD30037@ziepe.ca> (raw)
In-Reply-To: <20180704093211.o62tr44m3ugxxhjh@kili.mountain>

On Wed, Jul 04, 2018 at 08:01:57PM +0300, Dan Carpenter wrote:
> On Wed, Jul 04, 2018 at 08:49:47AM -0600, Jason Gunthorpe wrote:
> > On Wed, Jul 04, 2018 at 12:55:41PM +0200, HÃ¥kon Bugge wrote:
> > >    Is:
> > > 
> > >    if (ret < (int)nents) {
> > > 
> > >    a more intuitive fix?
> > 
> > That could lead to truncation/force negativeness of nents :(
> > 
> 
> In this case, if nents is over INT_MAX we're already toasted.

Ugh, yes, functions accepting int for unsigned values is any
alarmingly common mistake too.

> > I wonder how many bugs like this we have.
> 
> This is a static checker fix, so Julia fixed 3 and I fixed 6...

Leon found another case of implicit casting creating a user space
triggerable bug last week..

Jason
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-07-04 18:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04  9:32 [PATCH] IB/core: type promotion bug in rdma_rw_init_one_mr() Dan Carpenter
2018-07-04 10:41 ` Walter Harms
2018-07-04 10:48 ` Dan Carpenter
2018-07-04 14:49 ` Jason Gunthorpe
2018-07-04 16:27 ` Leon Romanovsky
2018-07-04 17:01 ` Dan Carpenter
2018-07-04 17:07 ` Dan Carpenter
2018-07-04 18:05 ` Jason Gunthorpe [this message]
2018-07-04 18:05 ` Jason Gunthorpe
2018-07-08 15:07 ` Christoph Hellwig

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=20180704180518.GD30037@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=kernel-janitors@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox