* [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure
@ 2026-12-02 23:01 Frederick Lawler
2026-12-02 23:05 ` netdev-bot+sinfo
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Frederick Lawler @ 2026-12-02 23:01 UTC (permalink / raw)
To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexander Lobakin,
Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
John Fastabend, Stanislav Fomichev, Michal Kubiak, Jacob Keller
Cc: intel-wired-lan, netdev, bpf, kernel-team, stable,
Frederick Lawler
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.
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: stable@vger.kernel.org # 6.18+
Signed-off-by: Frederick Lawler <fred@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 <fred@cloudflare.com>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure
2026-12-02 23:01 [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure Frederick Lawler
@ 2026-12-02 23:05 ` netdev-bot+sinfo
2026-12-02 23:16 ` Keller, Jacob E
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: netdev-bot+sinfo @ 2026-12-02 23:05 UTC (permalink / raw)
To: Frederick Lawler
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexander Lobakin,
Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
John Fastabend, Stanislav Fomichev, Michal Kubiak, Jacob Keller,
intel-wired-lan, netdev, bpf, kernel-team, stable
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- What hardware the change was tested on. For driver fixes please
mention the device (and if relevant firmware version) used for
testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure
2026-12-02 23:01 [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure Frederick Lawler
2026-12-02 23:05 ` netdev-bot+sinfo
@ 2026-12-02 23:16 ` Keller, Jacob E
2026-12-04 10:54 ` Francisco Javier Felix Belmonte
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Keller, Jacob E @ 2026-12-02 23:16 UTC (permalink / raw)
To: Frederick Lawler, Nguyen, Anthony L, Kitszel, Przemyslaw,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lobakin, Aleksander, Alexei Starovoitov,
Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
Stanislav Fomichev, Michal Kubiak
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
bpf@vger.kernel.org, kernel-team@cloudflare.com,
stable@vger.kernel.org
> -----Original Message-----
> From: Frederick Lawler <fred@cloudflare.com>
> Sent: Wednesday, December 2, 2026 3:02 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Eric Dumazet
> <edumazet@kernel.org>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Lobakin, Aleksander <aleksander.lobakin@intel.com>;
> Alexei Starovoitov <ast@kernel.org>; Daniel Borkmann
> <daniel@iogearbox.net>; Jesper Dangaard Brouer <hawk@kernel.org>; John
> Fastabend <john.fastabend@gmail.com>; Stanislav Fomichev
> <sdf@fomichev.me>; Michal Kubiak <michal.kubiak@intel.com>; Keller, Jacob
> E <jacob.e.keller@intel.com>
> Cc: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org;
> bpf@vger.kernel.org; kernel-team@cloudflare.com; stable@vger.kernel.org;
> Frederick Lawler <fred@cloudflare.com>
> Subject: [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure
>
> 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.
>
Seems straight forward enough of a fix.
Reviewed-by: Jacob Keller <Jacob.e.keller@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: stable@vger.kernel.org # 6.18+
> Signed-off-by: Frederick Lawler <fred@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 <fred@cloudflare.com>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure
2026-12-02 23:01 [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure Frederick Lawler
2026-12-02 23:05 ` netdev-bot+sinfo
2026-12-02 23:16 ` Keller, Jacob E
@ 2026-12-04 10:54 ` Francisco Javier Felix Belmonte
2026-12-04 14:56 ` Loktionov, Aleksandr
2026-12-04 15:22 ` Maciej Fijalkowski
4 siblings, 0 replies; 7+ messages in thread
From: Francisco Javier Felix Belmonte @ 2026-12-04 10:54 UTC (permalink / raw)
To: Frederick Lawler
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexander Lobakin,
Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
John Fastabend, Stanislav Fomichev, Michal Kubiak, Jacob Keller,
intel-wired-lan, netdev, bpf, kernel-team, stable
On Wed, 02 Dec 2026 17:01:46 -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.
We hit the same crash independently on 4 Dec 2026, on a production
KVM + Ceph host, so here is a second data point for the patch and the
stable backport:
- Kernel 7.3.6 (Gentoo gentoo-sources), not tainted before the oops.
NIC: E810-XXV for SFP [8086:159b] rev 02, firmware
4.20 0x8001b91f 1.3346.0.
- No XDP program is attached to either port. Without a program
ice_run_xdp() returns ICE_XDP_PASS, so every received frame goes
through construct_skb and any ice user can hit this, not only XDP
users. It may be worth saying so in the commit message, since the
subject reads as XDP-specific.
- The trigger was memory pressure: swap was full and the task that the
interrupt landed on was in direct reclaim (zswap writeback to swap).
That fits napi_build_skb() failing its GFP_ATOMIC allocation, which
leaves no trace in the log because napi_skb_cache_get() uses
__GFP_NOWARN.
- Because it runs in softirq on hardirq exit, the result is "Kernel
panic - not syncing: Fatal exception in interrupt", and the host
rebooted (kernel.panic is set). A second CPU oopsed at the same
address before the panic, so once memory is tight it is not a
one-off.
- CR2/RAX match yours: RAX is a 16M-aligned struct page address, which
is what virt_to_page(NULL) gives, i.e. xdp->data was NULL.
- The code is unchanged in v7.4-rc5, 7.3.7 and 6.18.66.
Trimmed oops, recovered from efi-pstore ("?" frames removed):
BUG: unable to handle page fault for address: ffffefbe3e000010
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: Oops: 0000 [#1] SMP
CPU: 24 UID: 267 PID: 54622 Comm: msgr-worker-1 Not tainted 7.3.6-gentoo-r1 #5 PREEMPTLAZY
Hardware name: MSI MSIS366/S3661, BIOS ES366AOC.10K 01/15/2025
RIP: 0010:libeth_xdp_return_buff_slow+0x2a/0x40 [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 b0 fe ff ff 48 8b 3b 31 d2 e8 76 f1 ff ff <48> 8b 78 10 48 89 c6 e8 5a fe ff ff 31 c0 48 89 03 5b c3 0f 1f 00
RAX: ffffefbe3e000000 RBX: ffffb04300718e10 RCX: ffff9d318028e8d0
CR2: ffffefbe3e000010 CR3: 00000001eb2cd000 CR4: 0000000000750ef0
Call Trace:
<IRQ>
ice_napi_poll+0xeb4/0x1080 [ice]
__napi_poll+0x103/0x1f0
net_rx_action+0x145/0x290
handle_softirqs+0xbc/0x250
__irq_exit_rcu+0x9d/0xd0
common_interrupt+0x79/0xa0
</IRQ>
<TASK>
asm_common_interrupt+0x22/0x40
RIP: 0010:_raw_spin_unlock_irq+0xc/0x20
raid5_get_active_stripe+0x183/0x430
raid5_make_request+0x20f/0x14b0
md_handle_request+0x1a1/0x370
__submit_bio+0x76/0x1b0
submit_bio_noacct_nocheck+0xfd/0x350
swap_write_submit+0x2e/0x50
shrink_memcg_cb+0x1ea/0x2a0
__list_lru_walk_one+0xe4/0x200
list_lru_walk_one+0x7/0x10
zswap_shrinker_scan+0x4c/0x80
do_shrink_slab+0x126/0x360
shrink_slab+0x2d4/0x490
shrink_one+0xd8/0x1c0
shrink_node+0xb9b/0xe90
do_try_to_free_pages+0xbb/0x470
try_to_free_pages+0xb5/0x1c0
__alloc_pages_slowpath.constprop.0+0x769/0x1420
__alloc_frozen_pages_noprof+0x33d/0x3a0
alloc_pages_node_noprof+0x37/0x60
skb_page_frag_refill+0xb6/0xe0
sk_page_frag_refill+0x18/0xa0
tcp_sendmsg_locked+0x2e1/0x1230
tcp_sendmsg+0x26/0x40
____sys_sendmsg+0xac/0x250
___sys_sendmsg+0x63/0x90
__sys_sendmsg+0x5c/0xc0
do_syscall_64+0x82/0x1260
entry_SYSCALL_64_after_hwframe+0x4b/0x53
</TASK>
---[ end trace 0000000000000000 ]---
BUG: unable to handle page fault for address: ffffefbe3e000010
Oops: Oops: 0000 [#2] SMP
CPU: 15 UID: 267 PID: 61928 Comm: tp_osd_tp Tainted: G D 7.3.6-gentoo-r1 #5 PREEMPTLAZY
RIP: 0010:libeth_xdp_return_buff_slow+0x2a/0x40 [libeth_xdp]
Kernel panic - not syncing: Fatal exception in interrupt
We had arrived at the same change, so the fix matches our analysis.
Since then we have applied the patch as posted on top of 7.3.7 and
rebooted another of our hosts into it, with the same NIC and firmware
(both ports up at 25G as Open vSwitch ports, no XDP program). It
boots and passes traffic normally, with no new warnings in dmesg.
That host is not short of memory, so the failure path itself has not
been hit there; the host that crashed gets the same kernel next. With
the fix, that path bumps rx_alloc_fail in ethtool -S instead of
oopsing, so we can report back if it ever goes up there.
Tested-by: Francisco Javier Felix Belmonte <ffelix@inode64.com>
Thanks for sending it.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure
2026-12-02 23:01 [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure Frederick Lawler
` (2 preceding siblings ...)
2026-12-04 10:54 ` Francisco Javier Felix Belmonte
@ 2026-12-04 14:56 ` Loktionov, Aleksandr
2026-12-04 15:22 ` Maciej Fijalkowski
4 siblings, 0 replies; 7+ messages in thread
From: Loktionov, Aleksandr @ 2026-12-04 14:56 UTC (permalink / raw)
To: Frederick Lawler, Nguyen, Anthony L, Kitszel, Przemyslaw,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lobakin, Aleksander, Alexei Starovoitov,
Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
Stanislav Fomichev, Michal Kubiak, Keller, Jacob E
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
bpf@vger.kernel.org, kernel-team@cloudflare.com,
stable@vger.kernel.org
> -----Original Message-----
> From: Frederick Lawler <fred@cloudflare.com>
> Sent: Thursday, December 3, 2026 12:02 AM
> To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Eric Dumazet
> <edumazet@kernel.org>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Lobakin, Aleksander <aleksander.lobakin@intel.com>;
> Alexei Starovoitov <ast@kernel.org>; Daniel Borkmann
> <daniel@iogearbox.net>; Jesper Dangaard Brouer <hawk@kernel.org>; John
> Fastabend <john.fastabend@gmail.com>; Stanislav Fomichev
> <sdf@fomichev.me>; Michal Kubiak <michal.kubiak@intel.com>; Keller,
> Jacob E <jacob.e.keller@intel.com>
> Cc: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org;
> bpf@vger.kernel.org; kernel-team@cloudflare.com; stable@vger.kernel.org;
> Frederick Lawler <fred@cloudflare.com>
> Subject: [PATCH net] ice: Fix page fault on XDP_PASS skb allocation
> failure
>
> 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.
>
> 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: stable@vger.kernel.org # 6.18+
> Signed-off-by: Frederick Lawler <fred@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 <fred@cloudflare.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure
2026-12-02 23:01 [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure Frederick Lawler
` (3 preceding siblings ...)
2026-12-04 14:56 ` Loktionov, Aleksandr
@ 2026-12-04 15:22 ` Maciej Fijalkowski
2026-12-04 15:37 ` Jesper Dangaard Brouer
4 siblings, 1 reply; 7+ messages in thread
From: Maciej Fijalkowski @ 2026-12-04 15:22 UTC (permalink / raw)
To: Frederick Lawler
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexander Lobakin,
Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
John Fastabend, Stanislav Fomichev, Michal Kubiak, Jacob Keller,
intel-wired-lan, netdev, bpf, kernel-team, stable
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 <maciej.fijalkowski@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: stable@vger.kernel.org # 6.18+
> Signed-off-by: Frederick Lawler <fred@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 <fred@cloudflare.com>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure
2026-12-04 15:22 ` Maciej Fijalkowski
@ 2026-12-04 15:37 ` Jesper Dangaard Brouer
0 siblings, 0 replies; 7+ messages in thread
From: Jesper Dangaard Brouer @ 2026-12-04 15:37 UTC (permalink / raw)
To: Maciej Fijalkowski, Frederick Lawler
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexander Lobakin,
Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Stanislav Fomichev, Michal Kubiak, Jacob Keller, intel-wired-lan,
netdev, bpf, kernel-team, stable
On 12/4/26 16:22, Maciej Fijalkowski wrote:
> 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?
>
This have been backported to CF kernels and is currently rolling to
production. I guess at the time of writing this was true.
> Besides, nice finding!
> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
--Jesper
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-12-04 15:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 23:01 [PATCH net] ice: Fix page fault on XDP_PASS skb allocation failure Frederick Lawler
2026-12-02 23:05 ` netdev-bot+sinfo
2026-12-02 23:16 ` Keller, Jacob E
2026-12-04 10:54 ` Francisco Javier Felix Belmonte
2026-12-04 14:56 ` Loktionov, Aleksandr
2026-12-04 15:22 ` Maciej Fijalkowski
2026-12-04 15:37 ` Jesper Dangaard Brouer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox