On Wed, Dec 02, 2026 at 05:01:46PM -0600, Frederick Lawler wrote:
> In the XDP_PASS receive path, xdp_build_skb_from_buff() can return > NULL when it cannot allocate an skb head. ICE currently clears > xdp->data before checking for that failure, then passes the buffer to > libeth_xdp_return_buff_slow(). The return helper needs xdp->data to > find and recycle the page-pool buffer, so the NULL pointer can cause > a page fault instead. > > Leave xdp->data intact on the failure path so the helper can recycle > the buffer; it clears the pointer afterward. On success, clear the > pointer only after the skb has taken ownership of the buffer. > > Observed on a real machine. Patch not yet tested on a real machine.
Hi Frederick, what stopped you from testing? Besides, nice finding! Reviewed-by: Maciej Fijalkowski <maci…@intel.com>
> > BUG: unable to handle page fault for address: ffc0e085fa000010 > PGD 0 > Oops: Oops: 0000 [#1] SMP NOPTI > RIP: 0010:libeth_xdp_return_buff_slow+0x33/0x50 [libeth_xdp] > Code: 53 48 89 fb f6 47 34 01 74 16 8b 47 30 48 8b 57 18 31 f6 48 8d bc 02 c0 fe ff ff e8 d7 fd ff ff 48 8b 3b e8 bf ed ff ff 31 d2 <48> 8b 78 10 48 89 c6 e8 61 fd ff ff 31 c0 48 89 03 5b e9 a1 3e 5b > RSP: 0018:ff80ef514ccb7ba0 EFLAGS: 00010246 > RAX: ffc0e085fa000000 RBX: ff80ef514ccb7c20 RCX: 0000000000000000 > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000080000000 > RBP: ff80ef514ccb7ca0 R08: 0000000000000246 R09: 0000000000000000 > R10: ffbe1c5fb6497e01 R11: 0000000000000003 R12: ff4ef6240d34a6a0 > R13: 0000000000000000 R14: ff4ef62bd9abe400 R15: 0000000000000536 > FS: 0000000000000000(0000) GS:ff4ef629f203f000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: ffc0e085fa000010 CR3: 00000034082dd004 CR4: 0000000000771ef0 > PKRU: 55555554 > Call Trace: > <TASK> > ice_napi_poll+0xd6f/0xf10 [ice] > __napi_poll+0xbf/0x200 > bpf_trampoline_6442499332+0x79/0x123 > __napi_poll+0x5/0x200 > net_rx_action+0x325/0x7c0 > handle_softirqs+0xd3/0x270 > run_ksoftirqd+0x25/0x30 > smpboot_thread_fn+0xf3/0x220 > kthread+0xfd/0x240 > ret_from_fork+0x12e/0x190 > ret_from_fork_asm+0x1a/0x30 > </TASK> > > Fixes: 93f53db9f9dc ("ice: switch to Page Pool") > Cc: stab…@vger.kernel.org # 6.18+ > Signed-off-by: Frederick Lawler <fr…@cloudflare.com> > --- > drivers/net/ethernet/intel/ice/ice_txrx.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c > index 35a480a1e172..a4b7d772e21e 100644 > --- a/drivers/net/ethernet/intel/ice/ice_txrx.c > +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c > @@ -1041,7 +1041,6 @@ static int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget) > > construct_skb: > skb = xdp_build_skb_from_buff(&xdp->base); > - xdp->data = NULL; > > /* exit if we failed to retrieve a buffer */ > if (!skb) { > @@ -1050,6 +1049,8 @@ static int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget) > continue; > } > > + xdp->data = NULL; > + > vlan_tci = ice_get_vlan_tci(rx_desc); > > /* probably a little skewed due to removing CRC */ > > --- > base-commit: c1c39137dcc3134010566ff29a81c93124efa539 > change-id: 20261202-ice-xdp-fix-upstream-c1c25b0547bd > > Best regards, > -- > Frederick Lawler <fr…@cloudflare.com> > >