All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Bing Zhao <bzhao@marvell.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] mwifiex: potential integer underflow in mwifiex_ret_wmm_get_status()
Date: Wed, 25 Sep 2013 18:23:59 +0000	[thread overview]
Message-ID: <20130925182359.GV6247@mwanda> (raw)
In-Reply-To: <477F20668A386D41ADCC57781B1F70430F45077CDA@SC-VEXCH1.marvell.com>

On Wed, Sep 25, 2013 at 09:25:46AM -0700, Bing Zhao wrote:
> Hi Dan,
> 
> > If "resp_len" gets set to negative then it counts as a high positive value.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > I spotted this reviewing the int => bool changes, but I don't have the
> > hardware and can't test it.
> 
> Thanks for spotting this potential integer underflow problem.
> 
> I think we can change the 'resp_len' variable type to a signed integer
> to fix this issue.

No, that doesn't work because the comparison against sizeof() get's
promoted to size_t.  In other words, negative values still count as
large positive values.

regards,
dan carpenter


WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Bing Zhao <bzhao@marvell.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] mwifiex: potential integer underflow in mwifiex_ret_wmm_get_status()
Date: Wed, 25 Sep 2013 21:23:59 +0300	[thread overview]
Message-ID: <20130925182359.GV6247@mwanda> (raw)
In-Reply-To: <477F20668A386D41ADCC57781B1F70430F45077CDA@SC-VEXCH1.marvell.com>

On Wed, Sep 25, 2013 at 09:25:46AM -0700, Bing Zhao wrote:
> Hi Dan,
> 
> > If "resp_len" gets set to negative then it counts as a high positive value.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > I spotted this reviewing the int => bool changes, but I don't have the
> > hardware and can't test it.
> 
> Thanks for spotting this potential integer underflow problem.
> 
> I think we can change the 'resp_len' variable type to a signed integer
> to fix this issue.

No, that doesn't work because the comparison against sizeof() get's
promoted to size_t.  In other words, negative values still count as
large positive values.

regards,
dan carpenter


  reply	other threads:[~2013-09-25 18:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-25  8:57 [patch] mwifiex: potential integer underflow in mwifiex_ret_wmm_get_status() Dan Carpenter
2013-09-25  8:57 ` Dan Carpenter
2013-09-25 16:25 ` Bing Zhao
2013-09-25 16:25   ` Bing Zhao
2013-09-25 18:23   ` Dan Carpenter [this message]
2013-09-25 18:23     ` Dan Carpenter
2013-09-25 23:10     ` Bing Zhao
2013-09-25 23:10       ` Bing Zhao
2013-09-26 20:57       ` Bing Zhao
2013-09-26 20:57         ` Bing Zhao
2013-09-26 21:07         ` Dan Carpenter
2013-09-26 21:07           ` Dan Carpenter
2013-09-26 21:57           ` Bing Zhao
2013-09-26 21:57             ` Bing Zhao
2013-10-10 17:26             ` John W. Linville
2013-10-10 17:26               ` John W. Linville
2013-10-10 18:02               ` Bing Zhao
2013-10-10 18:02                 ` Bing Zhao

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=20130925182359.GV6247@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=bzhao@marvell.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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 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.