From: "Michael S. Tsirkin" <mst@redhat.com>
To: Michael Dalton <mwdalton@google.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
lf-virt <virtualization@lists.linux-foundation.org>,
Eric Dumazet <edumazet@google.com>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH stable 1/2] virtio_net: fix error handling for mergeable buffers
Date: Wed, 25 Dec 2013 21:19:32 +0200 [thread overview]
Message-ID: <20131225191932.GB22071@redhat.com> (raw)
In-Reply-To: <CANJ5vPK-rs2d_TvZ3wuAXMK8ctoSvg2km8MpncMU+0cdk=TAsw@mail.gmail.com>
On Wed, Dec 25, 2013 at 10:33:37AM -0800, Michael Dalton wrote:
> Hi Michael, quick question below:
>
> On Wed, Dec 25, 2013 at 6:56 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > if (i >= MAX_SKB_FRAGS) {
> > pr_debug("%s: packet too long\n", skb->dev->name);
> > skb->dev->stats.rx_length_errors++;
> > - return -EINVAL;
> > + return NULL;
> > }
>
> Should this error handling path free the SKB before returning NULL?
> It seems like if we just return NULL we may leak memory.
>
> Best,
>
> Mike
It's a device error, but
I agree, if we touch this code anyway there's no reason not to handle
this consistently and do goto toward end of file.
It's not a backport anymore though - this code is gone upstream,
so I'll make it a separate patch I think.
--
MST
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Michael Dalton <mwdalton@google.com>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
Rusty Russell <rusty@rustcorp.com.au>,
Eric Dumazet <edumazet@google.com>,
Jason Wang <jasowang@redhat.com>,
lf-virt <virtualization@lists.linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH stable 1/2] virtio_net: fix error handling for mergeable buffers
Date: Wed, 25 Dec 2013 21:19:32 +0200 [thread overview]
Message-ID: <20131225191932.GB22071@redhat.com> (raw)
In-Reply-To: <CANJ5vPK-rs2d_TvZ3wuAXMK8ctoSvg2km8MpncMU+0cdk=TAsw@mail.gmail.com>
On Wed, Dec 25, 2013 at 10:33:37AM -0800, Michael Dalton wrote:
> Hi Michael, quick question below:
>
> On Wed, Dec 25, 2013 at 6:56 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > if (i >= MAX_SKB_FRAGS) {
> > pr_debug("%s: packet too long\n", skb->dev->name);
> > skb->dev->stats.rx_length_errors++;
> > - return -EINVAL;
> > + return NULL;
> > }
>
> Should this error handling path free the SKB before returning NULL?
> It seems like if we just return NULL we may leak memory.
>
> Best,
>
> Mike
It's a device error, but
I agree, if we touch this code anyway there's no reason not to handle
this consistently and do goto toward end of file.
It's not a backport anymore though - this code is gone upstream,
so I'll make it a separate patch I think.
--
MST
next prev parent reply other threads:[~2013-12-25 19:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-25 14:56 [PATCH stable 0/2] virtio-net: backport error handling bugfix Michael S. Tsirkin
2013-12-25 14:56 ` [PATCH stable 1/2] virtio_net: fix error handling for mergeable buffers Michael S. Tsirkin
2013-12-25 14:56 ` Michael S. Tsirkin
2013-12-25 18:33 ` Michael Dalton
2013-12-25 18:33 ` Michael Dalton
2013-12-25 19:19 ` Michael S. Tsirkin [this message]
2013-12-25 19:19 ` Michael S. Tsirkin
2013-12-26 6:35 ` Michael Dalton
2013-12-26 6:35 ` Michael Dalton
2013-12-26 7:28 ` Jason Wang
2013-12-26 7:28 ` Jason Wang
2013-12-25 14:56 ` [PATCH stable 2/2] virtio-net: make all RX paths handle erors consistently Michael S. Tsirkin
2013-12-25 14:56 ` Michael S. Tsirkin
2013-12-26 7:28 ` Jason Wang
2013-12-26 7:28 ` Jason Wang
2013-12-26 7:31 ` Zhi Yong Wu
2013-12-26 7:31 ` Zhi Yong Wu
2013-12-25 20:13 ` [PATCH stable] virtio_net: don't leak memory or block when too many frags Michael S. Tsirkin
2013-12-25 20:13 ` Michael S. Tsirkin
2013-12-26 6:35 ` Michael Dalton
2013-12-26 6:35 ` Michael Dalton
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=20131225191932.GB22071@redhat.com \
--to=mst@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mwdalton@google.com \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.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.