CVE-2021-46931
Severity CVSS v4.0:
Pending analysis
Type:
CWE-787
Out-of-bounds Write
Publication date:
27/02/2024
Last modified:
10/04/2024
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
net/mlx5e: Wrap the tx reporter dump callback to extract the sq<br />
<br />
Function mlx5e_tx_reporter_dump_sq() casts its void * argument to struct<br />
mlx5e_txqsq *, but in TX-timeout-recovery flow the argument is actually<br />
of type struct mlx5e_tx_timeout_ctx *.<br />
<br />
mlx5_core 0000:08:00.1 enp8s0f1: TX timeout detected<br />
mlx5_core 0000:08:00.1 enp8s0f1: TX timeout on queue: 1, SQ: 0x11ec, CQ: 0x146d, SQ Cons: 0x0 SQ Prod: 0x1, usecs since last trans: 21565000<br />
BUG: stack guard page was hit at 0000000093f1a2de (stack is 00000000b66ea0dc..000000004d932dae)<br />
kernel stack overflow (page fault): 0000 [#1] SMP NOPTI<br />
CPU: 5 PID: 95 Comm: kworker/u20:1 Tainted: G W OE 5.13.0_mlnx #1<br />
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014<br />
Workqueue: mlx5e mlx5e_tx_timeout_work [mlx5_core]<br />
RIP: 0010:mlx5e_tx_reporter_dump_sq+0xd3/0x180<br />
[mlx5_core]<br />
Call Trace:<br />
mlx5e_tx_reporter_dump+0x43/0x1c0 [mlx5_core]<br />
devlink_health_do_dump.part.91+0x71/0xd0<br />
devlink_health_report+0x157/0x1b0<br />
mlx5e_reporter_tx_timeout+0xb9/0xf0 [mlx5_core]<br />
? mlx5e_tx_reporter_err_cqe_recover+0x1d0/0x1d0<br />
[mlx5_core]<br />
? mlx5e_health_queue_dump+0xd0/0xd0 [mlx5_core]<br />
? update_load_avg+0x19b/0x550<br />
? set_next_entity+0x72/0x80<br />
? pick_next_task_fair+0x227/0x340<br />
? finish_task_switch+0xa2/0x280<br />
mlx5e_tx_timeout_work+0x83/0xb0 [mlx5_core]<br />
process_one_work+0x1de/0x3a0<br />
worker_thread+0x2d/0x3c0<br />
? process_one_work+0x3a0/0x3a0<br />
kthread+0x115/0x130<br />
? kthread_park+0x90/0x90<br />
ret_from_fork+0x1f/0x30<br />
--[ end trace 51ccabea504edaff ]---<br />
RIP: 0010:mlx5e_tx_reporter_dump_sq+0xd3/0x180<br />
PKRU: 55555554<br />
Kernel panic - not syncing: Fatal exception<br />
Kernel Offset: disabled<br />
end Kernel panic - not syncing: Fatal exception<br />
<br />
To fix this bug add a wrapper for mlx5e_tx_reporter_dump_sq() which<br />
extracts the sq from struct mlx5e_tx_timeout_ctx and set it as the<br />
TX-timeout-recovery flow dump callback.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
CPE | From | Up to |
---|---|---|
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.7.0 (including) | 5.10.90 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11.0 (including) | 5.15.13 (excluding) |
To consult the complete list of CPE names with products and versions, see this page