[PATCH] networking: fix potential deref-of-null

Xabier Oneca -- xOneca xoneca at gmail.com
Tue Mar 18 12:13:05 UTC 2025


Hello Adam,

> Is it valid for RTM_F_CLONED to be set but ci to be NULL? If so, this
> changes the semantics: "cache" will no longer be printed if RTM_F_CLONED
> is set and ci is NULL.

In kernel code it seems to set RTM_F_CLONED and RTA_CACHEINFO
independently in net/ipv6/route.c:rt6_fill_node() (note: for IPv4 it
seems RTM_F_CLONED is set unconditionally), didn't dig further.

So, the code can be simplified even more, then (pseudocode):

  if (RTM_F_CLONED) print("cache");
  if (RTA_CACHEINFO) { ci=...; print("expires..."); }

Cheers,

Xabier Oneca_,,_


More information about the busybox mailing list