pmaports/device/testing/linux-samsung-a6lte/fix-addrconf_rt_table-nullptr-deref.patch
Sergey Lisov 36bf4eb5fe
linux-samsung-a6lte: fix nullptr dereference (MR 5467)
I've had the kernel panic with a NULL pointer dereference in the
addrconf_rt_table function. I have no idea how it could be triggered,
but the fix is straightforward.
2024-08-15 10:03:42 +09:00

12 lines
373 B
Diff

--- a/net/ipv6/addrconf.c 2022-02-08 08:17:30.000000000 +0300
+++ b/net/ipv6/addrconf.c 2024-08-06 00:58:50.314960285 +0300
@@ -2125,6 +2125,9 @@
* - If < 0, put routes into table dev->ifindex + (-rt_table).
*/
struct inet6_dev *idev = in6_dev_get(dev);
+ if (!idev) {
+ return 0;
+ }
u32 table;
int sysctl = idev->cnf.accept_ra_rt_table;
if (sysctl == 0) {