Skip to content

nvme-fabrics: bound reconnect_delay, kato and fast_io_fail_tmo

Martin George linux-nvme 2 versions Applied

Status from this message: Thanks, applied to nvme-7.4.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 5 repliesApplied
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- 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.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3nvme-fabrics: bound reconnect_delay to avoid overflowdrivers/nvme/host/fabrics.c drivers/nvme/host/sysfs.c+2 -21 reply
2/3nvme-fabrics: bound keep_alive_tmo to avoid overflowdrivers/nvme/host/fabrics.c+1 -11 reply
3/3nvme-fabrics: bound fast_io_fail_tmo to avoid overflowdrivers/nvme/host/fabrics.c drivers/nvme/host/sysfs.c+7 -11 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLaurence ObermanChristoph Hellwig
SeriesR-b
1/3R-b R-b
2/3R-b R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] nvme-fabrics: bound reconnect_delay, kato and fast_io_fail_tmo

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(-)
Signature · 1 line
2.53.0