summary refs log tree commit diff
path: root/drivers
diff options
context:
space:
mode:
authorMaurizio Lombardi <mlombard@redhat.com>2021-11-12 15:16:12 +0100
committerChristoph Hellwig <hch@lst.de>2021-11-23 17:22:41 +0100
commit8e8aaf512a91ae44d40647a88b51326c7b0a70a8 (patch)
treebe2ae3b061d5052c8e22672d5890482334607cb8 /drivers
parent5a6254d55e2a9f7919ead8580d7aa0c7a382b26a (diff)
downloadlinux-8e8aaf512a91ae44d40647a88b51326c7b0a70a8.tar.gz
nvme-fabrics: ignore invalid fast_io_fail_tmo values
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvme/host/fabrics.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index c5a2b71c5268..282d54117e0a 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -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: