[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89iJEE69y=Vi2c_2uE6k2Sb4bM+k+D+4KVfrR4QjMFK-7=A@mail.gmail.com>
Date: Tue, 17 Dec 2024 13:40:49 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Ma Ke <make_ruc2021@....com>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, u.kleine-koenig@...libre.com, horms@...nel.org,
mdf@...nel.org, netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH v2] net: ethernet: fix NULL dereference in nixge_recv()
On Tue, Dec 17, 2024 at 12:25 PM Ma Ke <make_ruc2021@....com> wrote:
>
> Due to the failure of allocating the variable 'priv' in
> netdev_priv(ndev), this could result in 'priv->rx_bd_v' not being set
> during the allocation process of netdev_priv(ndev), which could lead
> to a null pointer dereference.
>
> Move while() loop with 'priv->rx_bd_v' dereference after the check
> for its validity.
>
> Found by code review.
>
> Cc: stable@...r.kernel.org
> Fixes: 492caffa8a1a ("net: ethernet: nixge: Add support for National Instruments XGE netdev")
> Signed-off-by: Ma Ke <make_ruc2021@....com>
> ---
> Changes in v2:
> - modified the bug description as suggestions;
> - modified the patch as the code style suggested.
I really do not understand this patch.
if priv->rx_bd_v allocation failed, surely the device is not
operational, because nixge_hw_dma_bd_init() returns -ENOMEM
Powered by blists - more mailing lists