RE: [Intel-wired-lan] [PATCH v3] i40e: Add checking for null for nlmsg_find_attr()

From: G, GurucharanX
Date: Tue Feb 07 2023 - 05:48:34 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of
> Natalia Petrova
> Sent: Wednesday, February 1, 2023 2:36 PM
> To: Brandeburg, Jesse <jesse.brandeburg@xxxxxxxxx>
> Cc: lvc-project@xxxxxxxxxxxxxxxx; intel-wired-lan@xxxxxxxxxxxxxxxx; Natalia
> Petrova <n.petrova@xxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; Eric
> Dumazet <edumazet@xxxxxxxxxx>; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; Jakub Kicinski
> <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH v3] i40e: Add checking for null for
> nlmsg_find_attr()
>
> 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 <n.petrova@xxxxxxxxxx>
> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@xxxxxxxxx>
> ---
> v3: Fixed mailing list.
> v2: The remark about the error code by Simon Horman
> <simon.horman@xxxxxxxxxxxx> 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(+)
>

Tested-by: Gurucharan G <gurucharanx.g@xxxxxxxxx> (A Contingent worker at Intel)