CVE-2026-100024: bnxt_en: don't leave an XDP program installed when the open fails
In the Linux kernel, the following vulnerability has been resolved:
bnxten: don't leave an XDP program installed when the open fails
bnxtxdpset() stores the new program and drops the reference on the old one before reopening the NIC. If bnxtopennic() then fails, ndobpf() returns an error with the new program still in bp->xdpprog. The caller treats the error as "nothing was installed" and drops its own reference, so bp->xdpprog is left pointing at a freed program and the next XDP update dereferences it:
BUG: unable to handle page fault for address: ff78ecc80ddd1038 RIP: 0010:bpfprogput+0x5/0x80 Call Trace: bnxtxdpset+0xad/0x1b0 [bnxten] devxdppropagate+0x36/0xa0 bondxdpset+0xeb/0x2d0 [bonding] devxdpinstall+0x1b1/0x350 bpfxdplinkupdate+0xc5/0x1b0 linkupdate+0x104/0x1e0 sysbpf+0x662/0xcf0
Seen on a 6.12 based kernel after bnxtallocmem() failed an order-4 allocation on a fragmented host:
bnxten 0000:a0:00.1 ens4f1np1: nic open fail (rc: fffffff4) bond1: (slave ens4f1np1): Error -12 calling ndobpf
Bonding is not required to hit this; a plain XDP attach on a bnxt interface takes the same path.
Restore the previous program when an attach or a replace fails, and recompute the page-mode and XDP TX ring configuration from it. The configuration matters because bnxtinitonerxring() only assigns rxr->xdpprog in page mode, and bnxtsetrxskbmode() derives dev->maxmtu from the installed program. Release the old program only once the change has been committed.
A detach is not undone. devxdpdetachlink() clears the core's record of the program even when the driver returns an error, so putting the program back would leave the driver running a program the core has already dropped. If the reopen fails during a detach, bnxtxdpset() therefore returns 0 with the device closed; bnxtopennic() has already logged the failure.
Found in a crash dump; the change was not tested on hardware.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In bnxt_xdp_set(), release the old XDP program only after the change is committed; on a failed attach or replace, restore the previous program and recompute page-mode and XDP TX ring configuration from it. Ensure a failed bnxt_open_nic() does not leave the new XDP program installed.