[PATCH v2 0/3] nvme-fabrics: bound reconnect_delay, kato and fast_io_fail_tmo
Martin George
martinus.gpy at gmail.com
Fri Nov 13 08:49:59 PST 2026
reconnect_delay, keep_alive_tmo (kato) and fast_io_fail_tmo are accepted
in seconds but later multiplied by HZ (and, for kato, by 1000) in 32-bit
arithmetic, so large values overflow and yield bogus timers. Bound all
three at parse/store time so the conversions can't wrap.
The target already does this for kato via NVMET_MAX_KATO, and the host
recently fixed the same class for admin_timeout/io_timeout (4a5aeebf1a00)
and partly for reconnect_delay (f92fe8dea19c).
Changes since v1:
- Add patch 3/3 bounding fast_io_fail_tmo, which is the same
"seconds * HZ" overflow class and was unbounded in both the parser
and the sysfs store (spotted by Laurence Oberman).
- 2/3: reword the changelog to drop the inaccurate "1000 >= HZ" claim;
the bound is safe because kato is unsigned, so "kato * HZ" cannot wrap
even where HZ > 1000 (noted by Laurence Oberman). No code change.
Martin George (3):
nvme-fabrics: bound reconnect_delay to avoid overflow
nvme-fabrics: bound keep_alive_tmo to avoid overflow
nvme-fabrics: bound fast_io_fail_tmo to avoid overflow
drivers/nvme/host/fabrics.c | 10 +++++++---
drivers/nvme/host/sysfs.c | 4 +++-
2 files changed, 10 insertions(+), 4 deletions(-)
--
2.53.0
More information about the Linux-nvme
mailing list