[PATCH v2] eal: return error on devargs truncation in hotplug MP messages
David Marchand
david.marchand at redhat.com
Thu Jun 25 09:23:44 CEST 2026
On Wed, 24 Jun 2026 at 02:11, Long Li <longli at microsoft.com> wrote:
>
> The EAL hotplug multi-process messaging uses a fixed-size buffer
> (EAL_DEV_MP_DEV_ARGS_MAX_LEN, 128 bytes) for device arguments.
> When devargs exceeds this limit, strlcpy silently truncates the
> string. This causes secondary processes to receive incomplete
> devargs during hotplug re-add, leading to failed port
> re-initialization.
>
> For example, a MANA PCI device with 6 mac= arguments:
>
> mac=AA:BB:CC:DD:EE:01,mac=AA:BB:CC:DD:EE:02,
> mac=AA:BB:CC:DD:EE:03,mac=AA:BB:CC:DD:EE:04,
> mac=AA:BB:CC:DD:EE:05,mac=AA:BB:CC:DD:EE:06
>
> produces a 131-byte devargs string that gets silently truncated
> to 127 bytes, losing the last MAC address.
>
> Return -E2BIG from rte_dev_probe() when devargs would be truncated,
> instead of silently corrupting data. rte_dev_remove() does not need
> the same check because the length was already validated at probe time.
>
> Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
> Cc: stable at dpdk.org
>
> Signed-off-by: Long Li <longli at microsoft.com>
Re-reading the function, I have one concern about the fix.
I agree there is a bug with multiprocess.
But this change here also imposes a limit to 128 that was not there
before, even if multiprocess is disabled.
It may not be a big problem, but we are calling the the multi process
machinerie when unneeded (it ends up with a ENOTSUP).
I sent a small patch on this topic, could you have a look please?
https://inbox.dpdk.org/dev/20260625072254.4190227-1-david.marchand@redhat.com/
--
David Marchand
More information about the dev
mailing list