Xen-Devel Archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <hawk@kernel.org>
To: netdev@vger.kernel.org
Cc: Jesper Dangaard Brouer <hawk@kernel.org>,
	arthurborsboom@gmail.com,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	wei.liu@kernel.org, paul@xen.org,
	Jakub Kicinski <kuba@kernel.org>,
	kirjanov@gmail.com, dkirjanov@suse.de,
	kernel-team@cloudflare.com, security@xenproject.org,
	andrew.cooper3@citrix.com, xen-devel@lists.xenproject.org
Subject: [PATCH net] xen-netfront: Add missing skb_mark_for_recycle
Date: Wed, 27 Mar 2024 13:14:56 +0100	[thread overview]
Message-ID: <171154167446.2671062.9127105384591237363.stgit@firesoul> (raw)

Notice that skb_mark_for_recycle() is introduced later than fixes tag in
6a5bcd84e886 ("page_pool: Allow drivers to hint on SKB recycling").

It is believed that fixes tag were missing a call to page_pool_release_page()
between v5.9 to v5.14, after which is should have used skb_mark_for_recycle().
Since v6.6 the call page_pool_release_page() were removed (in 535b9c61bdef
("net: page_pool: hide page_pool_release_page()") and remaining callers
converted (in commit 6bfef2ec0172 ("Merge branch
'net-page_pool-remove-page_pool_release_page'")).

This leak became visible in v6.8 via commit dba1b8a7ab68 ("mm/page_pool: catch
page_pool memory leaks").

Fixes: 6c5aa6fc4def ("xen networking: add basic XDP support for xen-netfront")
Reported-by: Arthur Borsboom <arthurborsboom@gmail.com>
Signed-off-by: Jesper Dangaard Brouer <hawk@kernel.org>
---
Compile tested only, can someone please test this

 drivers/net/xen-netfront.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index ad29f370034e..8d2aee88526c 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -285,6 +285,7 @@ static struct sk_buff *xennet_alloc_one_rx_buffer(struct netfront_queue *queue)
 		return NULL;
 	}
 	skb_add_rx_frag(skb, 0, page, 0, 0, PAGE_SIZE);
+	skb_mark_for_recycle(skb);
 
 	/* Align ip header to a 16 bytes boundary */
 	skb_reserve(skb, NET_IP_ALIGN);




             reply	other threads:[~2024-03-27 12:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 12:14 Jesper Dangaard Brouer [this message]
2024-03-28 22:31 ` [PATCH net] xen-netfront: Add missing skb_mark_for_recycle Marek Marczykowski-Górecki
2024-03-29  1:30 ` patchwork-bot+netdevbpf
2024-03-29  9:47 ` Arthur Borsboom
2024-04-02  8:20   ` Arthur Borsboom
2024-04-02 20:25     ` Arthur Borsboom
2024-04-25 13:39       ` George Dunlap
2024-04-25 15:13         ` Greg KH
2024-05-07 13:57           ` Andrew Cooper
2024-05-08 19:33             ` Greg KH

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=171154167446.2671062.9127105384591237363.stgit@firesoul \
    --to=hawk@kernel.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=arthurborsboom@gmail.com \
    --cc=dkirjanov@suse.de \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kernel-team@cloudflare.com \
    --cc=kirjanov@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul@xen.org \
    --cc=security@xenproject.org \
    --cc=wei.liu@kernel.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).