From: David Laight <david.laight.linux@gmail.com>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: Yao Sang <sangyao@kylinos.cn>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Eric Dumazet <edumazet@google.com>,
"Gustavo A . R . Silva" <gustavoars@kernel.org>,
netdev <netdev@vger.kernel.org>,
linux-rdma <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH net] net/mlx4: avoid GCC 10 __bad_copy_from() false positive
Date: Mon, 1 Jun 2026 13:14:16 +0100 [thread overview]
Message-ID: <20260601131416.318cfbd6@pumpkin> (raw)
In-Reply-To: <7a018189-021c-44d1-a46d-a75016818a0b@nvidia.com>
On Mon, 1 Jun 2026 14:00:15 +0300
Tariq Toukan <tariqt@nvidia.com> wrote:
> On 29/05/2026 9:45, Yao Sang wrote:
> > On Mon, May 25, 2026 at 01:47:59PM +0300, Tariq Toukan wrote:
...
> > Regarding David's suggestion of using a memset_user() loop, I've also
> > looked into it, but couldn't locate either of those APIs in the kernel
> > after check.Please let me know if you have any additional information
> > or suggestions.
> >
> > If this approach looks good to you, I'll send out the full v2 patch shortly.
> >
>
> That would work.
> Thanks.
>
I wasn't at all sure there was one, but a loop using a 'reasonable size'
buffer will be reasonably simple and fast.
I suspect an on-stack 256 byte buffer would be good enough.
If it were a really hot path there are other options, but this looked
like initialisation so performance isn't that critical.
(But you don't want a loop of put_user() because that will be slow.)
-- David
prev parent reply other threads:[~2026-06-01 12:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 10:21 [PATCH net] net/mlx4: avoid GCC 10 __bad_copy_from() false positive Yao Sang
2026-05-25 10:47 ` Tariq Toukan
2026-05-26 7:56 ` Paolo Abeni
2026-05-26 10:09 ` David Laight
[not found] ` <1780035629778309.247.seg@mailgw.kylinos.cn>
2026-05-29 6:45 ` Yao Sang
2026-06-01 11:00 ` Tariq Toukan
2026-06-01 12:14 ` David Laight [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260601131416.318cfbd6@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gustavoars@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sangyao@kylinos.cn \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox