[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAN8dotmVcmpqxO0SyPvit20Ny-tU3OMHr0LLoXRQ3bpPTS5WqA@mail.gmail.com>
Date: Fri, 16 Feb 2024 02:32:54 +0300
From: Rand Deeb <rand.sec96@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, deeb.rand@...fident.ru,
lvc-project@...uxtesting.org, voskresenski.stanislav@...fident.ru
Subject: Re: [PATCH] dl2k: Fix potential NULL pointer dereference in receive_packet()
On Thu, Feb 15, 2024 at 4:02 AM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Tue, 13 Feb 2024 23:09:00 +0300 Rand Deeb wrote:
> > + if (skb == NULL) {
>
> if (!skb) is more common
>
> > + np->rx_ring[entry].fraginfo = 0;
> > + printk (KERN_INFO
> > + "%s: receive_packet: "
> > + "Unable to re-allocate Rx skbuff.#%d\n",
> > + dev->name, entry);
>
> no prints on allocation failure, please, there logs will include OOM
> splats already. A counter as suggested by Jake would be better.
> --
> pw-bot: cr
Dear Jakub,
Thank you for your feedback and suggestions.
Regarding your comment on using `(!skb)` instead of `(skb == NULL)`, I
understand that `(!skb)` is more common and is also recommended by `
checkpatch.pl`. However, I chose to keep the original code style and logic
to maintain consistency and avoid confusion, especially for other
developers who might be familiar with the existing format. The same
applies to the `printk` statement. In the same function, there is an exact
block of code used; should I fix it too?
Powered by blists - more mailing lists