[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4ZAMCRQW8iiYXAb@stanley.mountain>
Date: Tue, 14 Jan 2025 13:45:04 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Alexander Lobakin <aleksander.lobakin@...el.com>
Cc: Jakub Kicinski <kuba@...nel.org>,
Louis Peens <louis.peens@...igine.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Quentin Monnet <qmo@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, bpf@...r.kernel.org,
oss-drivers@...igine.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH net] nfp: bpf: prevent integer overflow in
nfp_bpf_event_output()
[ I tried to send this email yesterday but apparently gmail blocked
it for security reasons? So weird. - dan ]
On Mon, Jan 13, 2025 at 01:32:11PM +0100, Alexander Lobakin wrote:
> From: Dan Carpenter <dan.carpenter@...aro.org>
> Date: Mon, 13 Jan 2025 09:18:39 +0300
>
> > The "sizeof(struct cmsg_bpf_event) + pkt_size + data_size" math could
> > potentially have an integer wrapping bug on 32bit systems. Check for
>
> Not in practice I suppose? Do we need to fix "never" bugs?
>
No, this is from static analysis. We don't need to fix never bugs.
This is called from nfp_bpf_ctrl_msg_rx() and nfp_bpf_ctrl_msg_rx_raw()
and I assumed that since pkt_size and data_size come from skb->data on
the rx path then they couldn't be trusted.
Where is the bounds checking?
regards,
dan carpenter
Powered by blists - more mailing lists