Skip to content

Commit

Permalink
nvme-fabrics: ignore invalid fast_io_fail_tmo values
Browse files Browse the repository at this point in the history
Valid fast_io_fail_tmo values are integers >= 0 or -1 (disabled).
Prevent userspace from setting arbitrary negative values.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Maurizio Lombardi authored and Christoph Hellwig committed Nov 23, 2021
1 parent 5a6254d commit 8e8aaf5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/nvme/host/fabrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,9 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
if (token >= 0)
pr_warn("I/O fail on reconnect controller after %d sec\n",
token);
else
token = -1;

opts->fast_io_fail_tmo = token;
break;
case NVMF_OPT_HOSTNQN:
Expand Down

0 comments on commit 8e8aaf5

Please sign in to comment.