ipv4: fib: Don't dump dying fib_info in fib_leaf_notify().
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c3852ef7f2f8f75a9f85a864bec1f6f5a3068eea · < 06b693d2eb6651a63ad85bad8673de3b7d4edd6d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ipv4: fib: Don't dump dying fib_info in fib_leaf_notify().
syzbot reported use-after-free in nsim_fib4_prepare_event(). [0]
The problem is that the following functions call fib_info_hold() / refcount_inc() while dumping fib_info under RCU, which is unsafe.
* mlxsw_sp_router_fib4_event() * rocker_router_fib_event() * nsim_fib4_prepare_event()
refcount_inc_not_zero() must be used, but it would be too late there.
Let's guarantee the lifetime of fib_info in fib_leaf_notify().
Note that IPv6 does not need the corresponding change since fib6_table_dump() holds fib6_table.tb6_lock.
From the CVE record · Linux
The Linux kernel can use a freed fib_info object while dumping IPv4 routing information for FIB notifications under RCU. The issue was reported in nsim_fib4_prepare_event(); the input does not establish how an attacker could trigger it or whether authentication or user interaction is required.
Engineers running the Linux kernel should check their deployments; affected versions are not specified.