Re: [PATCH net v3 4/4] selftests: net: check padded vnet hdr_len in tun and tap

From: Willem de Bruijn

Date: Thu Nov 19 2026 - 16:15:23 EST


Junyoung Jang wrote:
> Add tun and macvtap write tests with a 512-byte virtio header and a
> 14-byte Ethernet frame. A hdr_len of 256 must fail with -EINVAL
> because it exceeds the post-padding payload. A zero hdr_len must
> continue to accept the same valid frame.
>
> These tests exercise the common header parser through both drivers.
> On the unpatched kernel, each oversized hdr_len test accepts the
> packet instead of rejecting it.
>
> In x86-64 QEMU, the patched kernel passed all 105 tun and five tap
> selftests, including the new cases.
>
> Co-developed-by: Gwanhyun Lee <gwanhyunlee@xxxxxxxxx>
> Signed-off-by: Gwanhyun Lee <gwanhyunlee@xxxxxxxxx>
> Signed-off-by: Junyoung Jang <graypanda.inzag@xxxxxxxxx>

Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx>