Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] nvme-fabrics: bound reconnect_delay, kato and fast_io_fail_tmo
@ 2026-11-13 16:49 Martin George
  2026-11-13 16:50 ` [PATCH v2 1/3] nvme-fabrics: bound reconnect_delay to avoid overflow Martin George
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Martin George @ 2026-11-13 16:49 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, kbusch, sagi, loberman

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-20 19:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13 16:49 [PATCH v2 0/3] nvme-fabrics: bound reconnect_delay, kato and fast_io_fail_tmo Martin George
2026-11-13 16:50 ` [PATCH v2 1/3] nvme-fabrics: bound reconnect_delay to avoid overflow Martin George
2026-11-20 17:55   ` Christoph Hellwig
2026-11-13 16:50 ` [PATCH v2 2/3] nvme-fabrics: bound keep_alive_tmo " Martin George
2026-11-20 17:55   ` Christoph Hellwig
2026-11-13 16:50 ` [PATCH v2 3/3] nvme-fabrics: bound fast_io_fail_tmo " Martin George
2026-11-20 17:56   ` Christoph Hellwig
2026-11-13 16:57 ` [PATCH v2 0/3] nvme-fabrics: bound reconnect_delay, kato and fast_io_fail_tmo Laurence Oberman
2026-11-20 19:54 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox