Re: [PATCH] ipv6: ip6_fib: fix null-pointer dereference in ipv6_route_native_seq_show()

From: Jakub Kicinski
Date: Sun Nov 03 2024 - 10:56:54 EST


On Sun, 3 Nov 2024 04:08:20 +0800 Yi Zou wrote:
> Check if fib6_nh is non-NULL before accessing fib6_nh->fib_nh_gw_family
> in ipv6_route_native_seq_show() to prevent a null-pointer dereference.
> Assign dev as dev = fib6_nh ? fib6_nh->fib_nh_dev : NULL to ensure safe
> handling when nexthop_fib6_nh(rt->nh) returns NULL.

Are you just sending this patch because nexthop_fib6_nh() may return
NULL? Not sure it can happen since we know we're walking a v6-only
table here.

Please try to crash it and add a stack trace to the commit message.

BTW your last posting was white space damaged. Stick to git send-email