Subject: Re: [PATCH net] net: hsr: prevent NULL pointer dereference in hsr_proxy_announce()

From: Simon Horman <[email-masked]>
Date: Mon, 9 Sep 2024 09:40:17 +0100

On Sun, Sep 08, 2024 at 04:03:41AM +0900, Jeongjun Park wrote:
> In the function hsr_proxy_annouance() added in the previous commit 
> 5f703ce5c981 ("net: hsr: Send supervisory frames to HSR network 
> with ProxyNodeTable data"), the return value of the hsr_port_get_hsr() 
> function is not checked to be a NULL pointer, which causes a NULL 
> pointer dereference.
> 
> To solve this, we need to add code to check whether the return value 
> of hsr_port_get_hsr() is NULL.
> 
> Reported-by: [email-masked]
> Fixes: 5f703ce5c981 ("net: hsr: Send supervisory frames to HSR network with ProxyNodeTable data")
> Signed-off-by: Jeongjun Park <[email-masked]>

Thanks,

I agree with your analysis; that the cited commit introduced this problem;
and that this is an appropriate solution.

Reviewed-by: Simon Horman <[email-masked]>