From: Maurizio Lombardi Date: Fri, 12 Nov 2021 14:16:12 +0000 (+0100) Subject: nvme-fabrics: ignore invalid fast_io_fail_tmo values X-Git-Tag: v5.16-rc3~35^2~1^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e8aaf512a91ae44d40647a88b51326c7b0a70a8;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index c5a2b71c52686..282d54117e0ac 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: