diff --git a/patches.suse/bnxt-make-sure-we-return-pages-to-the-pool.patch b/patches.suse/bnxt-make-sure-we-return-pages-to-the-pool.patch new file mode 100644 index 0000000..32d7545 --- /dev/null +++ b/patches.suse/bnxt-make-sure-we-return-pages-to-the-pool.patch @@ -0,0 +1,45 @@ +From: Jakub Kicinski +Date: Tue, 10 Jan 2023 20:25:47 -0800 +Subject: bnxt: make sure we return pages to the pool +Patch-mainline: v6.2-rc4 +Git-commit: 97f5e03a4a27d27ee4fed0cdb1658c81cf2784db +References: bsc#1209079 + +Before the commit under Fixes the page would have been released +from the pool before the napi_alloc_skb() call, so normal page +freeing was fine (released page == no longer in the pool). + +After the change we just mark the page for recycling so it's still +in the pool if the skb alloc fails, we need to recycle. + +Same commit added the same bug in the new bnxt_rx_multi_page_skb(). + +Fixes: 1dc4c557bfed ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff") +Reviewed-by: Andy Gospodarek +Link: https://lore.kernel.org/r/20230111042547.987749-1-kuba@kernel.org +Signed-off-by: Jakub Kicinski +Acked-by: Thomas Bogendoerfer +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -990,7 +990,7 @@ static struct sk_buff *bnxt_rx_multi_pag + DMA_ATTR_WEAK_ORDERING); + skb = build_skb(page_address(page), PAGE_SIZE); + if (!skb) { +- __free_page(page); ++ page_pool_recycle_direct(rxr->page_pool, page); + return NULL; + } + skb_mark_for_recycle(skb); +@@ -1028,7 +1028,7 @@ static struct sk_buff *bnxt_rx_page_skb( + + skb = napi_alloc_skb(&rxr->bnapi->napi, payload); + if (!skb) { +- __free_page(page); ++ page_pool_recycle_direct(rxr->page_pool, page); + return NULL; + } + diff --git a/series.conf b/series.conf index 633edc6..238be25 100644 --- a/series.conf +++ b/series.conf @@ -36748,6 +36748,7 @@ patches.suse/regulator-da9211-Use-irq-handler-when-ready.patch patches.suse/nfc-pn533-Wait-for-out_urb-s-completion-in-pn533_usb.patch patches.suse/net-sched-disallow-noqueue-for-qdisc-classes.patch + patches.suse/bnxt-make-sure-we-return-pages-to-the-pool.patch patches.suse/drm-virtio-Fix-GEM-handle-creation-UAF.patch patches.suse/drm-i915-Reserve-enough-fence-slot-for-i915_vma_unbi.patch patches.suse/drm-i915-gt-Reset-twice.patch