public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Carlier <devnexen@gmail.com>
To: horatiu.vultur@microchip.com, UNGLinuxDriver@microchip.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org, David Carlier <devnexen@gmail.com>
Subject: [PATCH net v3 0/3] net: lan966x: fix page_pool error handling and error paths
Date: Sun,  5 Apr 2026 06:52:38 +0100	[thread overview]
Message-ID: <20260405055241.35767-1-devnexen@gmail.com> (raw)

This series fixes error handling around the lan966x page pool:                                                                                                        
                                                                                                                                                                        
    1/3 adds the missing IS_ERR check after page_pool_create(), preventing                                                                                              
        a kernel oops when the error pointer flows into     
        xdp_rxq_info_reg_mem_model().                                                                                                                                   
                                                                                                                                                                        
    2/3 plugs page pool leaks in the lan966x_fdma_rx_alloc() and                                                                                                        
        lan966x_fdma_init() error paths, now reachable after 1/3.                                                                                                       
                                                                                                                                                                        
    3/3 fixes a use-after-free and page pool leak in the    
        lan966x_fdma_reload() restore path, where the hardware could                                                                                                    
        resume DMA into pages already returned to the page pool.

David Carlier (3):
  net: lan966x: fix page_pool error handling in
    lan966x_fdma_rx_alloc_page_pool()
  net: lan966x: fix page pool leak in error paths
  net: lan966x: fix use-after-free and leak in lan966x_fdma_reload()

 .../ethernet/microchip/lan966x/lan966x_fdma.c | 28 ++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)

-- 
v2 -> v3:                                                                                                                                                             
    - 1/3: remove blank line between page_pool_create() and IS_ERR check (Jakub)
    - 2/3: drop rx->page_pool = NULL for consistency with lan966x_fdma_init()                                                                                           
           cleanup; update commit message accordingly (Jakub)                                                                                                           
    - 3/3: remove blank line between kmemdup() and !old_pages check (Jakub)                                                                                             
  v1 -> v2: address caller error paths raised by Jakub's review; add patches                                                                                            
           2/3 and 3/3                                                                                                                                                  
  v1: https://lore.kernel.org/netdev/20260402172823.83467-1-devnexen@gmail.com                                                                           
  v2: https://lore.kernel.org/netdev/20260403230714.10667-1-devnexen@gmail.com
2.53.0


             reply	other threads:[~2026-04-05  5:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-05  5:52 David Carlier [this message]
2026-04-05  5:52 ` [PATCH net v3 v3 1/3] net: lan966x: fix page_pool error handling in lan966x_fdma_rx_alloc_page_pool() David Carlier
2026-04-05  5:52 ` [PATCH net v3 v3 2/3] net: lan966x: fix page pool leak in error paths David Carlier
2026-04-05  5:52 ` [PATCH net v3 v3 3/3] net: lan966x: fix use-after-free and leak in lan966x_fdma_reload() David Carlier

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=20260405055241.35767-1-devnexen@gmail.com \
    --to=devnexen@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@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