Re: [bpf, xdp] headroom - was: Re: Question about to KMSAN: uninit-value in can_receive
From: Oliver Hartkopp
Date: Thu Jan 08 2026 - 11:31:31 EST
On 08.01.26 16:17, Jakub Kicinski wrote:
On Wed, 7 Jan 2026 16:34:13 +0100 Oliver Hartkopp wrote:
Alternatively perhaps for this particular use case you could use
something like metadata_dst to mark the frame as forwarded / annotate
with the originating ifindex?
I looked into it and the way how skb_dst is shared in the union behind
cb[] does not look very promising for skbs that wander up and down in
the network layer.
Maybe I'm misunderstanding, but skb_dst is only unioned with some
socket layer (TCP and sockmsg) fields, not with cb[]. It'd be
problematic if CAN gw frames had to traverse routing but I don't
think they do?
We are using skb's that are e.g. created on socket level and only
contain fixed struct can[|fd|xl]_frames that are written into CAN
controllers registers on netdev level. The skb is just a dumb container,
which passes qdiscs and are stored in the CAN device cache until the CAN
frame is sent successfully on the CAN bus. And when it was sent, the skb
is echo'ed back via netif_rx() so that all local applications can see
the real traffic on the CAN bus. So our skb's can go down and up.
I did some more investigation and created 5 RFC patches that solve the
issue with the problematic private headroom (struct can_skb_priv) in CAN
skbs.
I'll continue testing - but it looks pretty good so far.
Best regards,
Oliver