Re: [PATCH net-next 1/7] bpf: Keep XDP helpers within readable data
From: Björn Töpel
Date: Sun Nov 22 2026 - 15:05:06 EST
Stanislav Fomichev <sdf.kernel@xxxxxxxxx> writes:
> On 11/17, Björn Töpel wrote:
>> Devmem and io_uring zero-copy RX put payload in fragments that the
>> kernel cannot read. XDP helpers must not treat these fragments as
>> normal pages.
>>
>> Reject operations that read or write these fragments. Access to the
>
> [..]
>
>> linear part still works. Tail trimming does not read the payload;
>> clear the unreadable flag after it removes every fragment.
>
> I guess this is technically true, but why allow it at all? Easier/safer
> to reject tail trimming as well?
One, maybe convoluted, use-case would be TCP RST: discard the unreadable
payload, rewrite/checksum the headers, then XDP_TX. Can't do XDP_TX with
unreadable frags... I can't see any DROP/PASS cases FWIW.
We can add it later if anyone cares. I'll remove it in the next rev!
Thanks!
Björn