DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH] bpf: remove dependency on vla
Date: Fri, 15 Aug 2025 09:03:16 -0700	[thread overview]
Message-ID: <20250815090316.63b15b46@hermes.local> (raw)
In-Reply-To: <7c942773fe30436b888ff37db75880ee@huawei.com>

On Fri, 15 Aug 2025 14:26:07 +0000
Konstantin Ananyev <konstantin.ananyev@huawei.com> wrote:

> > The code for ethdev callbacks was using variable length arrays
> > which is a feature not supported on MSVC and later C standards.
> > Replace with alloca().  
> 
> I am not a big fun of such mechanical replacement of vla with alloca()
> Specially in that particular case, we can have internal function that uses
> fixed size array and in public one just call it several times in a loop.
> Again, using VLA here is probably a real security breach,
> as we put some assumptions on size of input arrays provided by user,
> which we probably shouldn't.    
> 
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

The other way to handle this is to break the loop into chunks.
But it ends up being more awkward to read, and more complex.

      reply	other threads:[~2025-08-15 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-03 16:16 Stephen Hemminger
2025-08-15 14:26 ` Konstantin Ananyev
2025-08-15 16:03   ` Stephen Hemminger [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=20250815090316.63b15b46@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@huawei.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;
as well as URLs for NNTP newsgroup(s).