net/mlx5: lag: Check for LAG device before creating debugfs
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 7f46a0b7327ae261f9981888708dbca22c283900 · < bf16bca6653679d8a514d6c1c5a2c67065033f14| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5: lag: Check for LAG device before creating debugfs
__mlx5_lag_dev_add_mdev() may return 0 (success) even when an error occurs that is handled gracefully. Consequently, the initialization flow proceeds to call mlx5_ldev_add_debugfs() even when there is no valid LAG context.
mlx5_ldev_add_debugfs() blindly created the debugfs directory and attributes. This exposed interfaces (like the members file) that rely on a valid ldev pointer, leading to potential NULL pointer dereferences if accessed when ldev is NULL.
Add a check to verify that mlx5_lag_dev(dev) returns a valid pointer before attempting to create the debugfs entries.
From the CVE record · Linux
The Linux kernel's net/mlx5 LAG code can create debugfs entries without a valid LAG context. If those entries are accessed in that state, they can cause a NULL pointer dereference. The input does not specify authentication requirements for accessing them.
Engineers running Linux kernels with the net/mlx5 driver should check their kernel's status; affected versions are not specified.