In the Linux kernel, the following vulnerability has been resolved:
net/ipv6: avoid possible UAF in ip6routempath_notify()
syzbot found another use-after-free in ip6routempath_notify() [1]
Commit f7225172f25a ("net/ipv6: prevent use after free in ip6routempath_notify") was not able to fix the root cause.
We need to defer the fib6inforelease() calls after ip6routempath_notify(), in the cleanup phase.
[1] BUG: KASAN: slab-use-after-free in rt6fillnode+0x1460/0x1ac0 Read of size 4 at addr ffff88809a07fc64 by task syz-executor.2/23037
CPU: 0 PID: 23037 Comm: syz-executor.2 Not tainted 6.8.0-rc4-syzkaller-01035-gea7f3cfaa588 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Call Trace: <TASK> dumpstack lib/dumpstack.c:88 [inline] dumpstacklvl+0x1e7/0x2e0 lib/dumpstack.c:106 printaddressdescription mm/kasan/report.c:377 [inline] printreport+0x167/0x540 mm/kasan/report.c:488 kasanreport+0x142/0x180 mm/kasan/report.c:601 rt6fillnode+0x1460/0x1ac0 inet6rtnotify+0x13b/0x290 net/ipv6/route.c:6184 ip6routempathnotify net/ipv6/route.c:5198 [inline] ip6routemultipathadd net/ipv6/route.c:5404 [inline] inet6rtmnewroute+0x1d0f/0x2300 net/ipv6/route.c:5517 rtnetlinkrcvmsg+0x885/0x1040 net/core/rtnetlink.c:6597 netlinkrcvskb+0x1e3/0x430 net/netlink/afnetlink.c:2543 netlinkunicastkernel net/netlink/afnetlink.c:1341 [inline] netlinkunicast+0x7ea/0x980 net/netlink/afnetlink.c:1367 netlinksendmsg+0xa3b/0xd70 net/netlink/afnetlink.c:1908 socksendmsgnosec net/socket.c:730 [inline] _socksendmsg+0x221/0x270 net/socket.c:745 _syssendmsg+0x525/0x7d0 net/socket.c:2584 _syssendmsg net/socket.c:2638 [inline] _syssendmsg+0x2b0/0x3a0 net/socket.c:2667 dosyscall64+0xf9/0x240 entrySYSCALL64afterhwframe+0x6f/0x77 RIP: 0033:0x7f73dd87dda9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f73de6550c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f73dd9ac050 RCX: 00007f73dd87dda9 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000005 RBP: 00007f73dd8ca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f73dd9ac050 R15: 00007ffdbdeb7858 </TASK>
Allocated by task 23037: kasansavestack mm/kasan/common.c:47 [inline] kasansavetrack+0x3f/0x80 mm/kasan/common.c:68 poisonkmallocredzone mm/kasan/common.c:372 [inline] kasankmalloc+0x98/0xb0 mm/kasan/common.c:389 kasankmalloc include/linux/kasan.h:211 [inline] _dokmallocnode mm/slub.c:3981 [inline] _kmalloc+0x22e/0x490 mm/slub.c:3994 kmalloc include/linux/slab.h:594 [inline] kzalloc include/linux/slab.h:711 [inline] fib6infoalloc+0x2e/0xf0 net/ipv6/ip6fib.c:155 ip6routeinfocreate+0x445/0x12b0 net/ipv6/route.c:3758 ip6routemultipathadd net/ipv6/route.c:5298 [inline] inet6rtmnewroute+0x744/0x2300 net/ipv6/route.c:5517 rtnetlinkrcvmsg+0x885/0x1040 net/core/rtnetlink.c:6597 netlinkrcvskb+0x1e3/0x430 net/netlink/afnetlink.c:2543 netlinkunicastkernel net/netlink/afnetlink.c:1341 [inline] netlinkunicast+0x7ea/0x980 net/netlink/afnetlink.c:1367 netlinksendmsg+0xa3b/0xd70 net/netlink/afnetlink.c:1908 socksendmsgnosec net/socket.c:730 [inline] _socksendmsg+0x221/0x270 net/socket.c:745 _syssendmsg+0x525/0x7d0 net/socket.c:2584 _syssendmsg net/socket.c:2638 [inline] _syssendmsg+0x2b0/0x3a0 net/socket.c:2667 dosyscall64+0xf9/0x240 entrySYSCALL64afterhwframe+0x6f/0x77
Freed by task 16: kasansavestack mm/kasan/common.c:47 [inline] kasansavetrack+0x3f/0x80 mm/kasan/common.c:68 kasansavefreeinfo+0x4e/0x60 mm/kasan/generic.c:640 poisonslab_object+0xa6/0xe0 m ---truncated---
{ "vanir_signatures": [ { "deprecated": false, "signature_type": "Function", "target": { "file": "net/ipv6/route.c", "function": "ip6_route_multipath_add" }, "id": "CVE-2024-26852-03ede4e3", "digest": { "length": 3199.0, "function_hash": "54036726384118917991267981610090088433" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@61b34f73cdbdb8eaf9ea12e9e2eb3b29716c4dda" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "net/ipv6/route.c" }, "id": "CVE-2024-26852-0c643f68", "digest": { "line_hashes": [ "329932770558022939982743207844819546651", "67147752048618866503005139886274042823", "327596062317232421025059114767546153266", "333375455110981910225162402900440401465", "172916583251627836201835083098102544551", "196608071897020515392568469955112723651", "2827141427943319728717635054999936029", "200598844081234437718997301546630545504", "158479828692990338796226597489955832320", "106543481236155278555628398135892751999", "238087326031033243745743461261625252861", "276978917376285756276263291413762293709", "216235479588388085617842618159841951778", "253725855823362038603897445114509163183", "61081683641780225315734445171020435937", "186559916815307249860330233889259660979", "275782348037499636440216504461968866887", "159995653586363088594994512269940877656", "218863588076892651371288584577373960922" ], "threshold": 0.9 }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@79ce2e54cc0ae366f45516c00bf1b19aa43e9abe" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "net/ipv6/route.c" }, "id": "CVE-2024-26852-0e4efa28", "digest": { "line_hashes": [ "329932770558022939982743207844819546651", "67147752048618866503005139886274042823", "327596062317232421025059114767546153266", "333375455110981910225162402900440401465", "172916583251627836201835083098102544551", "196608071897020515392568469955112723651", "2827141427943319728717635054999936029", "200598844081234437718997301546630545504", "158479828692990338796226597489955832320", "106543481236155278555628398135892751999", "238087326031033243745743461261625252861", "276978917376285756276263291413762293709", "216235479588388085617842618159841951778", "253725855823362038603897445114509163183", "61081683641780225315734445171020435937", "186559916815307249860330233889259660979", "275782348037499636440216504461968866887", "159995653586363088594994512269940877656", "218863588076892651371288584577373960922" ], "threshold": 0.9 }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@61b34f73cdbdb8eaf9ea12e9e2eb3b29716c4dda" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "net/ipv6/route.c", "function": "ip6_route_multipath_add" }, "id": "CVE-2024-26852-17267863", "digest": { "length": 3123.0, "function_hash": "194467307648656794880130689467229834277" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@664f9c647260cc9d68b4e31d9899530d89dd045e" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "net/ipv6/route.c", "function": "ip6_route_multipath_add" }, "id": "CVE-2024-26852-1b9f0fa5", "digest": { "length": 3199.0, "function_hash": "54036726384118917991267981610090088433" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@79ce2e54cc0ae366f45516c00bf1b19aa43e9abe" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "net/ipv6/route.c" }, "id": "CVE-2024-26852-227d518b", "digest": { "line_hashes": [ "329932770558022939982743207844819546651", "67147752048618866503005139886274042823", "327596062317232421025059114767546153266", "333375455110981910225162402900440401465", "172916583251627836201835083098102544551", "196608071897020515392568469955112723651", "2827141427943319728717635054999936029", "200598844081234437718997301546630545504", "158479828692990338796226597489955832320", "106543481236155278555628398135892751999", "238087326031033243745743461261625252861", "276978917376285756276263291413762293709", "216235479588388085617842618159841951778", "253725855823362038603897445114509163183", "61081683641780225315734445171020435937", "186559916815307249860330233889259660979", "275782348037499636440216504461968866887", "159995653586363088594994512269940877656", "218863588076892651371288584577373960922" ], "threshold": 0.9 }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@685f7d531264599b3f167f1e94bbd22f120e5fab" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "net/ipv6/route.c" }, "id": "CVE-2024-26852-2a2a5019", "digest": { "line_hashes": [ "329932770558022939982743207844819546651", "67147752048618866503005139886274042823", "327596062317232421025059114767546153266", "333375455110981910225162402900440401465", "172916583251627836201835083098102544551", "196608071897020515392568469955112723651", "2827141427943319728717635054999936029", "200598844081234437718997301546630545504", "158479828692990338796226597489955832320", "106543481236155278555628398135892751999", "238087326031033243745743461261625252861", "276978917376285756276263291413762293709", "216235479588388085617842618159841951778", "253725855823362038603897445114509163183", "61081683641780225315734445171020435937", "186559916815307249860330233889259660979", "275782348037499636440216504461968866887", "159995653586363088594994512269940877656", "218863588076892651371288584577373960922" ], "threshold": 0.9 }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ed883060c38721ed828061f6c0c30e5147326c9a" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "net/ipv6/route.c", "function": "ip6_route_multipath_add" }, "id": "CVE-2024-26852-3be01a96", "digest": { "length": 3199.0, "function_hash": "54036726384118917991267981610090088433" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@685f7d531264599b3f167f1e94bbd22f120e5fab" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "net/ipv6/route.c", "function": "ip6_route_multipath_add" }, "id": "CVE-2024-26852-44cdb4b5", "digest": { "length": 2705.0, "function_hash": "273757744916734721525496550998756551773" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@31ea5bcc7d4cd1423de6be327a2c034725704136" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "net/ipv6/route.c", "function": "ip6_route_multipath_add" }, "id": "CVE-2024-26852-4ed2ee73", "digest": { "length": 3199.0, "function_hash": "54036726384118917991267981610090088433" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ed883060c38721ed828061f6c0c30e5147326c9a" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "net/ipv6/route.c" }, "id": "CVE-2024-26852-9054c9d7", "digest": { "line_hashes": [ "329932770558022939982743207844819546651", "67147752048618866503005139886274042823", "327596062317232421025059114767546153266", "333375455110981910225162402900440401465", "172916583251627836201835083098102544551", "196608071897020515392568469955112723651", "2827141427943319728717635054999936029", "200598844081234437718997301546630545504", "158479828692990338796226597489955832320", "144743216201134959233260843715400815844", "33525703368250679975849440711329549959", "177711228612209057686123701385318928871", "240268359834603590664874012382816161028", "276978917376285756276263291413762293709", "216235479588388085617842618159841951778", "253725855823362038603897445114509163183", "61081683641780225315734445171020435937", "186559916815307249860330233889259660979", "275782348037499636440216504461968866887", "159995653586363088594994512269940877656", "218863588076892651371288584577373960922" ], "threshold": 0.9 }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@31ea5bcc7d4cd1423de6be327a2c034725704136" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "net/ipv6/route.c", "function": "ip6_route_multipath_add" }, "id": "CVE-2024-26852-bcd8553b", "digest": { "length": 3199.0, "function_hash": "54036726384118917991267981610090088433" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cae3303257950d03ffec2df4a45e836f10d26c24" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "net/ipv6/route.c" }, "id": "CVE-2024-26852-be49d2d5", "digest": { "line_hashes": [ "329932770558022939982743207844819546651", "67147752048618866503005139886274042823", "327596062317232421025059114767546153266", "333375455110981910225162402900440401465", "172916583251627836201835083098102544551", "196608071897020515392568469955112723651", "2827141427943319728717635054999936029", "200598844081234437718997301546630545504", "158479828692990338796226597489955832320", "106543481236155278555628398135892751999", "238087326031033243745743461261625252861", "276978917376285756276263291413762293709", "216235479588388085617842618159841951778", "253725855823362038603897445114509163183", "61081683641780225315734445171020435937", "186559916815307249860330233889259660979", "275782348037499636440216504461968866887", "159995653586363088594994512269940877656", "218863588076892651371288584577373960922" ], "threshold": 0.9 }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@664f9c647260cc9d68b4e31d9899530d89dd045e" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "net/ipv6/route.c" }, "id": "CVE-2024-26852-dc16703c", "digest": { "line_hashes": [ "329932770558022939982743207844819546651", "67147752048618866503005139886274042823", "327596062317232421025059114767546153266", "333375455110981910225162402900440401465", "172916583251627836201835083098102544551", "196608071897020515392568469955112723651", "2827141427943319728717635054999936029", "200598844081234437718997301546630545504", "158479828692990338796226597489955832320", "106543481236155278555628398135892751999", "238087326031033243745743461261625252861", "276978917376285756276263291413762293709", "216235479588388085617842618159841951778", "253725855823362038603897445114509163183", "61081683641780225315734445171020435937", "186559916815307249860330233889259660979", "275782348037499636440216504461968866887", "159995653586363088594994512269940877656", "218863588076892651371288584577373960922" ], "threshold": 0.9 }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cae3303257950d03ffec2df4a45e836f10d26c24" } ] }