nvme-host: prevent nvme-cli from setting invalid fast_io_fail_tmo values
PATCH 1/1 nvme-host: prevent nvme-cli from setting 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 <[email protected]>
--- drivers/nvme/host/fabrics.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/host/fabrics.c +3 -0
@@ -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 :
Signature · 1 line
2.27.0
Reviewed-by Sagi Grimberg <[email protected]>
Quoted 4 lines · Maurizio Lombardi
Valid
fast_io_fail_tmovalues are integers >= 0 or -1 (disabled). Prevent userspace from setting arbitrary negative values.Signed-off-by Maurizio Lombardi <[email protected]>
Looks good.
Reviewed-by Chaitanya Kulkarni <[email protected]>
Christoph Hellwig
maintainerThanks,
applіed to nvme-5.16.