[PATCH v2 0/3] nvme-fabrics: bound reconnect_delay, kato and fast_io_fail_tmo
Laurence Oberman
loberman at redhat.com
Fri Nov 13 08:57:19 PST 2026
On Fri, 2026-11-13 at 22:19 +0530, Martin George wrote:
> 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(-)
Looks good.
For the V2 series
Reviewed-by: Laurence Oberman <loberman at redhat.com>
More information about the Linux-nvme
mailing list