AF_XDP zero-copy kept packet metadata in user-writable memory
A kernel series moves fragment lists out of UMEM after review found out-of-bounds reads and writes on the zero-copy receive path.
Linux networking patches from Björn Töpel stop AF_XDP zero-copy receive from storing a packet's fragment list and fragment count in user-writable memory. In multi-buffer zero-copy mode that metadata lived in the tail of the head chunk of the socket's UMEM. Userspace can write the UMEM at any time, including while the kernel is walking fragments, so a rewritten list or count makes the kernel read and write out of bounds.
The series keeps that shared info in the kernel buffer pool, which outlives the buffers and the queues that point at them. One structure per pool is enough, because a pool builds one multi-buffer packet at a time. Devices may then write to the end of each chunk, matching what single-buffer pools already allowed, and an XDP program can grow a zero-copy packet to the end of its chunk.
Related bugs in code that assumed the old layout are fixed in the same series. Intel's libeth helpers counted buffers in an XDP_TX frame from shared info read later, at a bulk flush, so a rewritten count could make idpf complete the wrong buffers. The generic conversion of a zero-copy XDP buffer into an skb sized the head from the whole frame and rounded copies up, so a long packet could overwrite the new skb's shared info. On a 2K chunk with no UMEM headroom and the default MTU, Töpel writes, the sender controls up to 48 bytes of that structure, including its fragment list. i40e, igb, igc and ixgbe rounded their copies up to eight bytes and could read past the data into the guard page after the UMEM.
The Intel copy bug was reproduced on igb in QEMU: an AF_XDP zero-copy socket using only the last UMEM chunk, with an XDP program that grew the packet to the end of the chunk, faulted in memcpy. The same test passes with the fix. Clément Lecigne of Google had reported the generic skb-sizing flaw earlier. The multi-buffer metadata issue and several of the follow-on bugs were found by an AI code review agent and had not been seen at runtime. Maciej Fijalkowski, who suggested keeping the shared info in the pool, reviewed the skb and Intel copy fixes and is sending a separate ice fix. Multi-buffer zero-copy and the generic skb builder were not covered by the posted tests.