CVE-2026-72343

Source
https://cve.org/CVERecord?id=CVE-2026-72343
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-72343.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-72343
Downstream
Published
2026-08-15T05:55:49.067Z
Modified
2026-08-16T03:48:37.396796576Z
Summary
net/mlx5e: Fix HV VHCA stats zero-sized buffer allocation
Details

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 mlx5eopen_channel().

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 ZEROSIZE_PTR.

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 mlx5ehvvhcafill_stats() 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 mlx5ehvvhcastats_destroy() 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 stats_nch on demand.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/72xxx/CVE-2026-72343.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
fa691d0c9c0812b9045f3a9420862e47b3b92518
Fixed
3b3a552cf88e10bb7bda88b29cf1fd8267043d50
Fixed
5b927dcec5f1087942bf123a82e64a3f66475f01
Fixed
22c1d5ecccf92c849bdca1556179aafc95794baf
Fixed
420aabb32da4381d8d7cdcaa6a77fad9eaceb0a4
Fixed
abc4c56427f144c96b2827a4db3b90eb5b7349a2
Fixed
25f6b929c7e379cbea7cb8caa67b49b2d1efae17

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-72343.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.17.0
Fixed
6.1.178
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.145
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.97
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.40
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
7.1.5

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-72343.json"