CVE-2026-139140: ipv6: Protect multiple routes insertion by table lock.
In the Linux kernel, the following vulnerability has been resolved:
ipv6: Protect multiple routes insertion by table lock.
syzbot reported the warning below. [0]
While callfib6multipathentrynotifiers() is called locklessly, fib6siblings could be changed concurrently, leading to the warning (and later null-ptr-deref).
Let's protect multiple routes insertion with tb6lock.
Along with that, ip6insrt() and ip6routedel() are changed to fib6add() and fib6del().
Note that fib6del() finally calls rt6multipathrebalance(), which requires rcureadlock().
[0]: i != fen6info->nsiblings WARNING: drivers/net/netdevsim/fib.c:831 at nsimfib6eventinit drivers/net/netdevsim/fib.c:831 [inline], CPU#0: syz.0.157/6279 WARNING: drivers/net/netdevsim/fib.c:831 at nsimfib6prepareevent drivers/net/netdevsim/fib.c:947 [inline], CPU#0: syz.0.157/6279 WARNING: drivers/net/netdevsim/fib.c:831 at nsimfibeventschedulework drivers/net/netdevsim/fib.c:1003 [inline], CPU#0: syz.0.157/6279 WARNING: drivers/net/netdevsim/fib.c:831 at nsimfibeventnb+0x1029/0x11d0 drivers/net/netdevsim/fib.c:1043, CPU#0: syz.0.157/6279 Modules linked in: CPU: 0 UID: 0 PID: 6279 Comm: syz.0.157 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 RIP: 0010:nsimfib6eventinit drivers/net/netdevsim/fib.c:831 [inline] RIP: 0010:nsimfib6prepareevent drivers/net/netdevsim/fib.c:947 [inline] RIP: 0010:nsimfibeventschedulework drivers/net/netdevsim/fib.c:1003 [inline] RIP: 0010:nsimfibeventnb+0x1029/0x11d0 drivers/net/netdevsim/fib.c:1043 Code: eb 0d 4d 89 fd e8 b7 c5 6c fa be 01 00 00 00 48 89 df e8 5a 38 85 fd 4d 89 ef 4c 8b 6c 24 20 e9 4a f3 ff ff e8 98 c5 6c fa 90 <0f> 0b 90 e9 db fa ff ff 89 e9 80 e1 07 80 c1 03 38 c1 0f 8c df f0 RSP: 0018:ffffc900047bef10 EFLAGS: 00010293 RAX: ffffffff875b59a8 RBX: 0000000000000002 RCX: ffff888079770000 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001 RBP: ffffc900047bf0a0 R08: ffff88805c0bb02f R09: 1ffff1100b817605 R10: dffffc0000000000 R11: ffffed100b817606 R12: dffffc0000000000 R13: 0000000000000000 R14: 0000000000000001 R15: ffff88802c792000 FS: 00007f334ba076c0(0000) GS:ffff888123ad0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f334ba06ff8 CR3: 000000007a5b2000 CR4: 00000000003526f0 Call Trace: <TASK> notifiercallchain+0x1a5/0x3d0 kernel/notifier.c:85 atomicnotifiercallchain+0xda/0x180 kernel/notifier.c:223 callfibnotifiers+0x31/0x60 net/core/fibnotifier.c:36 callfib6multipathentrynotifiers+0xf5/0x160 net/ipv6/ip6fib.c:428 ip6routemultipathadd net/ipv6/route.c:5542 [inline] inet6rtmnewroute+0x14f5/0x1a30 net/ipv6/route.c:5664 rtnetlinkrcvmsg+0x802/0xc00 net/core/rtnetlink.c:7163 netlinkrcvskb+0x226/0x4a0 net/netlink/afnetlink.c:2572 netlinkunicastkernel net/netlink/afnetlink.c:1335 [inline] netlinkunicast+0x7bd/0x940 net/netlink/afnetlink.c:1361 netlinksendmsg+0x813/0xb40 net/netlink/afnetlink.c:1916 socksendmsgnosec+0x14e/0x190 net/socket.c:800 socksendmsg net/socket.c:818 [inline] syssendmsg+0x54e/0x850 net/socket.c:2715 syssendmsg+0x2a5/0x360 net/socket.c:2769 syssendmmsg+0x273/0x4d0 net/socket.c:2858 dosyssendmmsg net/socket.c:2885 [inline] sesyssendmmsg net/socket.c:2882 [inline] x64syssendmmsg+0xa0/0xc0 net/socket.c:2882 dosyscallx64 arch/x86/entry/syscall64.c:61 [inline] dosyscall64+0x166/0x520 arch/x86/entry/syscall64.c:84 entrySYSCALL64afterhwframe+0x77/0x7f RIP: 0033:0x7f334ab9e1d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f334ba07028 EFLAGS: 00000246 ORIGRAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f334ae26090 RCX: 00007f334ab9e1d9 RDX: 04000000000001f2 RSI: 0 ---truncated---