All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] usb: gadget: f_fs: signedness bug in __ffs_func_bind_do_descs()
Date: Wed, 10 Sep 2014 11:05:25 +0000	[thread overview]
Message-ID: <20140910110525.GP6549@mwanda> (raw)
In-Reply-To: <20140909120609.GB19760@mwanda>

On Tue, Sep 09, 2014 at 06:37:02PM +0200, Michal Nazarewicz wrote:
> On Tue, Sep 09 2014, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > On Tue, Sep 09, 2014 at 03:57:26PM +0200, Michal Nazarewicz wrote:
> >> On Tue, Sep 09 2014, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >> > Btw, there is a sparse warning:
> >> >
> >> > drivers/usb/gadget/function/f_fs.c:401:44: warning: Variable length array is used.
> >> >
> >> > The risk here is that the array would be too large.  I don't know the
> >> > code well enough to say if it can be triggered, but from an outsider
> >> > perspective it looks scary (security implications).  There should be a
> >> > comment explaining why it can't be used to overflow the 8k stack.
> >> 
> >> n in that function can be at most 4
> >
> > I looked for where this limit is set but couldn't figure it out.  Which
> > function is it?
> 
> The limit is never explicitly set, but logic in this function guarantees
> it:
> 

Ok.  Thanks.  I maybe could have found this on my own because I store
this sort of information in Smatch except that "ev" is an anonymous
struct.

regards,
dan carpenter


      parent reply	other threads:[~2014-09-10 11:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 12:06 [patch] usb: gadget: f_fs: signedness bug in __ffs_func_bind_do_descs() Dan Carpenter
2014-09-09 13:57 ` Michal Nazarewicz
2014-09-09 14:25 ` Dan Carpenter
2014-09-09 16:37 ` Michal Nazarewicz
2014-09-09 16:40 ` Felipe Balbi
2014-09-10 11:05 ` 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=20140910110525.GP6549@mwanda \
    --to=dan.carpenter@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.