summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorShao Mingyin <shao.mingyin@zte.com.cn>2026-11-05 21:58:07 +0800
committerKeith Busch <kbusch@kernel.org>2026-11-09 09:44:58 -0800
commitf92fe8dea19c743eb9e4d998ae0384344dd40091 (patch)
tree199198f6ed7c939cf33140b6265efc8b5ed5f6a1 /tools/perf/scripts/python
parent976311c5594a7a26047891f087ad59a804e02baa (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