diff options
| author | Shao Mingyin <shao.mingyin@zte.com.cn> | 2026-11-05 21:58:07 +0800 |
|---|---|---|
| committer | Keith Busch <kbusch@kernel.org> | 2026-11-09 09:44:58 -0800 |
| commit | f92fe8dea19c743eb9e4d998ae0384344dd40091 (patch) | |
| tree | 199198f6ed7c939cf33140b6265efc8b5ed5f6a1 /tools/perf/scripts/python | |
| parent | 976311c5594a7a26047891f087ad59a804e02baa (diff) | |
nvme: reject invalid reconnect_delay sysfs values
nvme_ctrl_reconnect_delay_store() stores whatever kstrtou32() accepted
into opts->reconnect_delay without validating it. The nvme-fabrics
option parser refuses reconnect_delay values that are zero or negative,
and the rest of the driver relies on that: nvme_ctrl_loss_tmo_store()
computes
opts->max_reconnects = DIV_ROUND_UP(ctrl_loss_tmo,
opts->reconnect_delay);
Writing 0 to reconnect_delay and then a positive value to ctrl_loss_tmo
therefore divides by zero in the kernel. In addition, a value larger
than INT_MAX is truncated to a negative int in the assignment and
silently bypasses the checks done by the fabrics parser.
Reject zero and values that do not fit into the signed int field.
Fixes: 764075fdcb2f ("nvme: expose reconnect_delay and ctrl_loss_tmo via sysfs")
Cc: stable@vger.kernel.org
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
