From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: Eric Dumazet <edumazet@google.com>
Cc: netdev@vger.kernel.org, Jiayuan Chen <jiayuan.chen@shopee.com>,
syzbot+3d8bc31c45e11450f24c@syzkaller.appspotmail.com,
Jiri Pirko <jiri@resnulli.us>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v1] team: fix header_ops type confusion with non-Ethernet ports
Date: Sat, 14 Mar 2026 19:51:32 +0800 [thread overview]
Message-ID: <d2f9bd52-f570-441b-b3aa-570cc7f37d0c@linux.dev> (raw)
In-Reply-To: <CANn89iLp8eaAj4Qtu4dvGeh9zEw+aQFe=n2dMd-zs4n-cjV4QQ@mail.gmail.com>
On 3/14/26 7:46 PM, Eric Dumazet wrote:
>> Thanks,
>>
>> I reproduced the infinite recursion you described with stacked bonds
>> (bond1 -> bond0 -> gre0). With an AF_PACKET SOCK_DGRAM socket on bond1
>> and an inbound GRE packet, bond_header_parse() recurses endlessly
>> because skb->dev always points to bond1.
>>
>> I can verify this patch, but changing the parse() signature touches
>> quite a few places beyond what's in the diff - net/mac802154/iface.c,
>> net/phonet/af_phonet.c, drivers/firewire/net.c all have their own
>> parse() implementations that need updating, plus eth_header_parse() is
>> declared in both etherdevice.h and if_ether.h.
>>
>> I'm wondering if adding a separate callback (e.g. dev_parse) to
>> struct header_ops might be a cleaner approach - dev_parse_header()
>> would check for the new callback first and fall back to the existing
>> parse(). That way only bond (and team) need to implement it, and all
>> other drivers remain untouched. The tradeoff is one extra NULL check
>> in the receive path, which should be negligible.
> My patch is ready and already running our tests before I submit it.
>
> git show | diffstat -p1
> drivers/firewire/net.c | 5 +++--
> drivers/net/bonding/bond_main.c | 8 +++++---
> include/linux/etherdevice.h | 3 ++-
> include/linux/if_ether.h | 3 ++-
> include/linux/netdevice.h | 6 ++++--
> net/ethernet/eth.c | 3 ++-
> net/ipv4/ip_gre.c | 3 ++-
> net/mac802154/iface.c | 4 +++-
> net/phonet/af_phonet.c | 5 ++++-
> 9 files changed, 27 insertions(+), 13 deletions(-)
>
> I see no issue with this fix, ->parse() is hardly in a fast path anyway.
>
> Note that ->create() already has a 'struct net_device' pointer.
Thanks for the quick patch.
I also verified it fixes the recursion issue after modifying all signatures.
next prev parent reply other threads:[~2026-03-14 11:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 6:23 [PATCH net v1] team: fix header_ops type confusion with non-Ethernet ports Jiayuan Chen
2026-03-14 10:19 ` Eric Dumazet
2026-03-14 11:14 ` Eric Dumazet
2026-03-14 11:41 ` Jiayuan Chen
2026-03-14 11:46 ` Eric Dumazet
2026-03-14 11:51 ` Jiayuan Chen [this message]
2026-03-14 11:53 ` Eric Dumazet
2026-03-14 11:57 ` Eric Dumazet
2026-03-14 12:05 ` Jiayuan Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d2f9bd52-f570-441b-b3aa-570cc7f37d0c@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiayuan.chen@shopee.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+3d8bc31c45e11450f24c@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox