[PATCH 0/2] nvme-fabrics: bound reconnect_delay and keep_alive_tmo

Laurence Oberman loberman at redhat.com
Fri Nov 13 05:01:34 PST 2026


On Fri, 2026-11-13 at 15:39 +0530, Martin George wrote:
> reconnect_delay and keep_alive_tmo (kato) 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 both 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).
> 
> Martin George (2):
>   nvme-fabrics: bound reconnect_delay to avoid timer overflow
>   nvme-fabrics: bound keep_alive_tmo to avoid overflow
> 
>  drivers/nvme/host/fabrics.c | 4 ++--
>  drivers/nvme/host/sysfs.c   | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

For the series:

Looks good

Reviewed-by: Laurence Oberman <loberman at redhat.com>

One thought: fast_io_fail_tmo looks like the same class -- it's
scheduled as fast_io_fail_tmo * HZ in nvme_start_failfast_work() and
isn't upper-bounded in the parser or sysfs store. Might be worth
folding into this series.

Minor nit on 2/2: "1000 >= HZ" doesn't hold on every arch (alpha
allows HZ=1024/1200), though kato being unsigned keeps it safe here.




More information about the Linux-nvme mailing list