From: David Vrabel <david.vrabel@citrix.com>
To: David Miller <davem@davemloft.net>
Cc: <v.maffione@gmail.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <xen-devel@lists.xenproject.org>,
<boris.ostrovsky@oracle.com>
Subject: Re: [Xen-devel] [PATCH] drivers: net: xen-netfront: fix array initialization bug
Date: Mon, 14 Apr 2014 18:25:34 +0100 [thread overview]
Message-ID: <534C1A0E.1080307@citrix.com> (raw)
In-Reply-To: <20140414.125131.1934050779129550948.davem@davemloft.net>
On 14/04/14 17:51, David Miller wrote:
> From: David Vrabel <david.vrabel@citrix.com>
> Date: Mon, 14 Apr 2014 10:42:20 +0100
>
>> On 12/04/14 21:51, David Miller wrote:
>>> From: Vincenzo Maffione <v.maffione@gmail.com>
>>> Date: Sat, 12 Apr 2014 11:55:40 +0200
>>>
>>>> This patch fixes the initialization of an array used in the TX
>>>> datapath that was mistakenly initialized together with the
>>>> RX datapath arrays. An out of range array access could happen
>>>> when RX and TX rings had different sizes.
>>>>
>>>> Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com>
>>>
>>> Good catch, applied, thanks.
>>
>> Thanks. You can queue this for net-next since the Tx and Rx rings are
>> the same constant size.
>
> I was able to determine when I reviewed this patch that the size in bytes
> of the rings are the same (PAGE_SIZE), but I couldn't ascertain whether
> the individual ring entries in the TX ring and RX ring are the same size.
>
> Are they?
Yes. It's not at all obvious, but each ends up with 256 entries.
Tx entries are 12 bytes and Rx entries are 8 bytes. The ring macros
reserve some space in the shared page for the producer/consumer indexes
/and/ round down the number to the next power of two.
David
prev parent reply other threads:[~2014-04-14 17:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-12 9:55 [PATCH] drivers: net: xen-netfront: fix array initialization bug Vincenzo Maffione
2014-04-12 20:51 ` David Miller
2014-04-14 9:42 ` [Xen-devel] " David Vrabel
2014-04-14 16:51 ` David Miller
2014-04-14 17:25 ` David Vrabel [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=534C1A0E.1080307@citrix.com \
--to=david.vrabel@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=v.maffione@gmail.com \
--cc=xen-devel@lists.xenproject.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