[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<DB3PR10MB68352DF6CB458CCF97C416ECE8A5A@DB3PR10MB6835.EURPRD10.PROD.OUTLOOK.COM>
Date: Fri, 3 Nov 2023 19:12:57 +0530
From: Yuran Pereira <yuran.pereira@...mail.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
florian.fainelli@...adcom.com, linux-kernel@...r.kernel.org,
justin.chen@...adcom.com, edumazet@...gle.com,
bcm-kernel-feedback-list@...adcom.com, kuba@...nel.org,
pabeni@...hat.com, linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH] Prevent out-of-bounds read/write in bcmasp_netfilt_rd
and bcmasp_netfilt_wr
Hello Greg,
On Fri, Nov 03, 2023 at 01:57:13PM +0100, Greg KH wrote:
> > reg_offset = bcmasp_netfilt_get_reg_offset(priv, nfilt, reg_type,
> > offset);
> > + if (reg_offset < 0)
> > + return 0;
>
> Shouldn't you return an error here?
Yes, I think that makes sense. I might just return `reg_offset`
since it is bound to be -EINVAL when bcmasp_netfilt_get_reg_offset
fails.
But that now makes me wonder whether the previous check in that
function which currently returns 0, shouldn't be returning `-EINVAL`
instead.
```
static u32 bcmasp_netfilt_rd(struct bcmasp_priv *priv,
...
{
if (!IS_ALIGNED(offset, 4) || offset > MAX_WAKE_FILTER_SIZE)
return 0; <----- Should this one be -EINVAL?
}
```
Thank you for the feedback.
Yuran
Powered by blists - more mailing lists