From: Alexander Duyck <alexander.duyck@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: alexander.h.duyck@intel.com, netdev@vger.kernel.org,
jeffrey.t.kirsher@intel.com
Subject: Re: [PATCH 1/2] tcp: Fix out of bounds access to tcpm_vals
Date: Wed, 11 Jul 2012 18:46:51 -0700 [thread overview]
Message-ID: <4FFE2C8B.7080802@gmail.com> (raw)
In-Reply-To: <20120711.173249.1303803416502735349.davem@davemloft.net>
On 7/11/2012 5:32 PM, David Miller wrote:
> From: Alexander Duyck<alexander.h.duyck@intel.com>
> Date: Wed, 11 Jul 2012 17:18:04 -0700
>
>> The recent patch "tcp: Maintain dynamic metrics in local cache." introduced
>> an out of bounds access due to what appears to be a typo. I believe this
>> change should resolve the issue by replacing the access to RTAX_CWND with
>> TCP_METRIC_CWND.
>>
>> Signed-off-by: Alexander Duyck<alexander.h.duyck@intel.com>
> Applied, thanks a lot.
>
> How did you spot this, did you get a compiler warning?
>
> I ask because while working on this, I at one point put the
> tcp timestamp members after the metrics array in the
> tcp_metrics_bucket struct. And I got a warning from gcc about
> an array bounds violation that I could not figure out.
>
> I am pretty certain this bug here is what it was warning about. And
> the problem is that if you put the array at the end gcc doesn't warn
> in order to handle things similar to what people use zero length
> arrays for.
It came up as a compiler warning. I suspect it may have something to do
with the optimizations I had turned on since it complained that the
issue was in tcp_update_metrics but then reported it on the one line in
tcp_metric_set.
Thanks,
Alex
prev parent reply other threads:[~2012-07-12 1:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 0:18 [PATCH 1/2] tcp: Fix out of bounds access to tcpm_vals Alexander Duyck
2012-07-12 0:18 ` [PATCH 2/2] net: Update alloc frag to reduce get/put page usage and recycle pages Alexander Duyck
2012-07-12 0:29 ` Eric Dumazet
2012-07-12 1:11 ` David Miller
2012-07-12 2:02 ` Alexander Duyck
2012-07-12 5:06 ` Eric Dumazet
2012-07-12 15:33 ` Alexander Duyck
2012-07-12 0:32 ` [PATCH 1/2] tcp: Fix out of bounds access to tcpm_vals David Miller
2012-07-12 1:46 ` Alexander Duyck [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=4FFE2C8B.7080802@gmail.com \
--to=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=davem@davemloft.net \
--cc=jeffrey.t.kirsher@intel.com \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).