Subject: Re: [PATCH v2] i40e: Add checking for null for nlmsg_find_attr()

From: Greg Kroah-Hartman <[email-masked]>
Date: Tue, 31 Jan 2023 06:17:49 +0100

On Tue, Jan 31, 2023 at 01:11:06AM +0300, Natalia Petrova wrote:
> The result of nlmsg_find_attr() 'br_spec' is dereferenced in
> nla_for_each_nested(), but it can take null value in nla_find() function,
> which will result in an error.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: 51616018dd1b ("i40e: Add support for getlink, setlink ndo ops")
> Signed-off-by: Natalia Petrova <[email-masked]>
> Reviewed-by: Jesse Brandeburg <[email-masked]>
> ---
> v2: The remark about the error code by Simon Horman <[email-masked]> 
> was taken into account; return value -ENOENT was changed to -EINVAL.
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++
>  1 file changed, 2 insertions(+)
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>