CVE-2026-72343: net/mlx5e: Fix HV VHCA stats zero-sized buffer allocation

Published Aug 15, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

net/mlx5e: Fix HV VHCA stats zero-sized buffer allocation

mlx5ehvvhcastatscreate() is called from mlx5enicenable(), before mlx5eopen(). At that point priv->statsnch is still zero, because it is only ever incremented in mlx5echannelstatsalloc(), which is reached only from mlx5eopenchannel().

mlx5ehvvhcastatsbufsize() therefore returns 0, and kvzalloc(0, GFPKERNEL) returns ZEROSIZEPTR ((void )16) rather than NULL. The "if (!buf)" guard does not catch this, and mlx5ehvvhcastatscreate() completes "successfully" with priv->statsagent.buf set to ZEROSIZEPTR.

Once channels are opened (priv->statsnch > 0) and the hypervisor enables stats reporting, mlx5ehvvhcastatswork() recomputes buflen using the new non-zero statsnch and calls memset(buf, 0, buflen) on ZEROSIZEPTR, faulting at address 0x10.

Allocate the buffer based on priv->maxnch, which is set in mlx5eprivinit() and is the upper bound on statsnch:

- Add a separate helper mlx5ehvvhcastatsbufmaxsize() that returns sizeof(perringstats) max(maxnch, statsnch), and use it for the kvzalloc() in mlx5ehvvhcastatscreate(). - Keep mlx5ehvvhcastatsbufsize() (which returns based on statsnch) for the worker's active payload size, so the wire format (block->rings = statsnch) and the amount of data filled by mlx5ehvvhcafillstats() are unchanged.

The max(maxnch, statsnch) guard handles the rare case where mlx5eattachnetdev() recomputes maxnch downward across a detach/resume cycle while priv->statsnch persists (mlx5edetachnetdev does not call mlx5eprivcleanup, so statsnch is only reset when the netdev is destroyed). Without the guard, the worker could compute buflen from statsnch and overrun the smaller buffer allocated based on the reduced maxnch.

Allocating a non-zero buffer also makes the kvzalloc() failure path in mlx5ehvvhcastatscreate() reachable for the first time: it returns early without (re)creating the agent. Clear priv->statsagent.{agent,buf} in mlx5ehvvhcastatsdestroy() after freeing them, so that if a later create() bails out on this path, a subsequent teardown does not double-free the stale agent/buffer left from a previous enable/disable cycle.

This mirrors the existing mlx5e pattern of preallocating arrays of size maxnch (e.g. priv->channelstats) and lazily populating entries up to statsnch on demand.

Event History

Aug 15, 2026
CVE Published
via MITRE·05:55 AM
Data Sourced
via MITRE·05:55 AM
Description
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203