mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: Jason Wang <jasowang@redhat.com>
Cc: mst@redhat.com, jasowang@redhat.com,
	virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] virtio-net: fix pages leaking when building skb in big mode
Date: Sat, 18 Sep 2021 09:56:13 +0800	[thread overview]
Message-ID: <1631930173.5851955-1-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <20210917083406.75602-1-jasowang@redhat.com>

On Fri, 17 Sep 2021 16:34:06 +0800, Jason Wang <jasowang@redhat.com> wrote:
> We try to use build_skb() if we had sufficient tailroom. But we forget
> to release the unused pages chained via private in big mode which will
> leak pages. Fixing this by release the pages after building the skb in
> big mode.
>
> Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> Fixes: fb32856b16ad ("virtio-net: page_to_skb() use build_skb when there's sufficient tailroom")
> Signed-off-by: Jason Wang <jasowang@redhat.com>

LGTM

Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>

Thanks.


> ---
>  drivers/net/virtio_net.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 271d38c1d9f8..79bd2585ec6b 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -423,6 +423,10 @@ static struct sk_buff *page_to_skb(struct virtnet_info *vi,
>
>  		skb_reserve(skb, p - buf);
>  		skb_put(skb, len);
> +
> +		page = (struct page *)page->private;
> +		if (page)
> +			give_pages(rq, page);
>  		goto ok;
>  	}
>
> --
> 2.25.1
>

  reply	other threads:[~2021-09-18  1:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17  8:34 Jason Wang
2021-09-18  1:56 ` Xuan Zhuo [this message]
2021-09-19 11:20 ` patchwork-bot+netdevbpf

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=1631930173.5851955-1-xuanzhuo@linux.alibaba.com \
    --to=xuanzhuo@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®