]> www.infradead.org Git - users/dwmw2/linux.git/commit
Merge branch 'net-fix-lwtunnel-reentry-loops'
authorPaolo Abeni <pabeni@redhat.com>
Thu, 20 Mar 2025 10:25:55 +0000 (11:25 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 20 Mar 2025 10:25:56 +0000 (11:25 +0100)
commitf31b6fbfe8c7f1da319b5a51a08ed730bf7e7fc2
tree601a74870b5582f60ed6cb23a7980fa33facb172
parent47a9b5e52abd2b717dfc8b9460589f89936d93cf
parent3ed61b8938c66680e13a1d1929afb9b145c26a86
Merge branch 'net-fix-lwtunnel-reentry-loops'

Justin Iurman says:

====================
net: fix lwtunnel reentry loops

When the destination is the same after the transformation, we enter a
lwtunnel loop. This is true for most of lwt users: ioam6, rpl, seg6,
seg6_local, ila_lwt, and lwt_bpf. It can happen in their input() and
output() handlers respectively, where either dst_input() or dst_output()
is called at the end. It can also happen in xmit() handlers.

Here is an example for rpl_input():

dump_stack_lvl+0x60/0x80
rpl_input+0x9d/0x320
lwtunnel_input+0x64/0xa0
lwtunnel_input+0x64/0xa0
lwtunnel_input+0x64/0xa0
lwtunnel_input+0x64/0xa0
lwtunnel_input+0x64/0xa0
[...]
lwtunnel_input+0x64/0xa0
lwtunnel_input+0x64/0xa0
lwtunnel_input+0x64/0xa0
lwtunnel_input+0x64/0xa0
lwtunnel_input+0x64/0xa0
ip6_sublist_rcv_finish+0x85/0x90
ip6_sublist_rcv+0x236/0x2f0

... until rpl_do_srh() fails, which means skb_cow_head() failed.

This series provides a fix at the core level of lwtunnel to catch such
loops when they're not caught by the respective lwtunnel users, and
handle the loop case in ioam6 which is one of the users. This series
also comes with a new selftest to detect some dst cache reference loops
in lwtunnel users.
====================

Link: https://patch.msgid.link/20250314120048.12569-1-justin.iurman@uliege.be
Signed-off-by: Paolo Abeni <pabeni@redhat.com>