Re: [PATCH net] net/sched: act_ife: use mac_len for ingress header offset

Victor Nogueira <[email protected]>
Newsgroups org.kernel.vger.netdev
Message-ID <CA+NMeC_00ZwOZcnLmL6giND4TY4LhFVNXi_5XFdwXgmAJcpbtw@mail.gmail.com>
On Tue, Aug 11, 2026 at 9:45 PM Jakub Kicinski <[email protected]> wrote:
>
> On Mon, 10 Aug 2026 11:42:01 -0300 Victor Nogueira wrote:
> > On ingress, the L2 header stripped from the frame is skb->mac_len, not
> > skb->dev->hard_header_len. Use it for the skb_push/skb_pull offsets in
> > tcf_ife_encode()/tcf_ife_decode() and the matching header length inside
> > ife_encode()/ife_decode(). On egress keep hard_header_len.
> >
> > For devices where hard_header_len differs from mac_len (e.g. PPP, which
> > reports 4 vs 0), the previous code pushed/pulled the wrong amount and
> > could hit skb_under_panic on ingress when headroom was tight.
>
> Clashiko points out that act_ife operates on Ethernet headers
> pretty explicitly. IOW we're fixing a crash in a case that
> functionally won't work, anyway.
>
> Should we not simply drop all the packets if they are are destined
> for a non ARPHRD_ETHER device?

You have a point, but I need to double check.
I'll discuss this with Jamal and get back to you.

cheers,
Victor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.