From: Dan Carpenter <dan.carpenter@oracle.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] module: static checker complains about negative values
Date: Tue, 20 May 2014 11:19:58 +0300 [thread overview]
Message-ID: <20140520081957.GD15585@mwanda> (raw)
In-Reply-To: <87y4xxi5nn.fsf@rustcorp.com.au>
On Tue, May 20, 2014 at 11:16:04AM +0930, Rusty Russell wrote:
> Dan Carpenter <dan.carpenter@oracle.com> writes:
>
> > We cap "stat.size" at INT_MAX but we don't check for negative values so
> > my static checker complains. At this point, you already have control of
> > the kernel and if you start passing negative values here then you
> > deserve what happens next.
> >
> > On 64 bit systems the vmalloc() will definitely fail. On 32 bit systems
> > we truncate the upper 32 bits away so that could succeed. I haven't
> > followed it further than that.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> If vfs_getattr() returns a negative stat.size, we have worse problems.
>
> I'd rather see you sprinkle assertions like that into the code, so we
> can make sure that can't happen for any fs's getattr().
Yeah. I was lazy. Sorry. I can just hand edit my database to say that
i_size_read() returns a reasonable number...
regards,
dan carpenter
prev parent reply other threads:[~2014-05-20 8:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-19 20:36 [patch] module: static checker complains about negative values Dan Carpenter
2014-05-20 1:46 ` Rusty Russell
2014-05-20 8:19 ` 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=20140520081957.GD15585@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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