* [PATCH] nvme-host: prevent nvme-cli from setting invalid fast_io_fail_tmo values
@ 2021-11-12 14:16 Maurizio Lombardi
2021-11-14 10:32 ` Sagi Grimberg
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Maurizio Lombardi @ 2021-11-12 14:16 UTC (permalink / raw)
To: linux-nvme; +Cc: sagi, hch, kbusch
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>
---
drivers/nvme/host/fabrics.c | 3 +++
1 file changed, 3 insertions(+)
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:
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-host: prevent nvme-cli from setting invalid fast_io_fail_tmo values
2021-11-12 14:16 [PATCH] nvme-host: prevent nvme-cli from setting invalid fast_io_fail_tmo values Maurizio Lombardi
@ 2021-11-14 10:32 ` Sagi Grimberg
2021-11-18 1:44 ` Chaitanya Kulkarni
2021-11-23 16:23 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2021-11-14 10:32 UTC (permalink / raw)
To: Maurizio Lombardi, linux-nvme; +Cc: hch, kbusch
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-host: prevent nvme-cli from setting invalid fast_io_fail_tmo values
2021-11-12 14:16 [PATCH] nvme-host: prevent nvme-cli from setting invalid fast_io_fail_tmo values Maurizio Lombardi
2021-11-14 10:32 ` Sagi Grimberg
@ 2021-11-18 1:44 ` Chaitanya Kulkarni
2021-11-23 16:23 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-11-18 1:44 UTC (permalink / raw)
To: Maurizio Lombardi, linux-nvme; +Cc: sagi, hch, kbusch
On 11/12/21 06:16, Maurizio Lombardi wrote:
> 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>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-host: prevent nvme-cli from setting invalid fast_io_fail_tmo values
2021-11-12 14:16 [PATCH] nvme-host: prevent nvme-cli from setting invalid fast_io_fail_tmo values Maurizio Lombardi
2021-11-14 10:32 ` Sagi Grimberg
2021-11-18 1:44 ` Chaitanya Kulkarni
@ 2021-11-23 16:23 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2021-11-23 16:23 UTC (permalink / raw)
To: Maurizio Lombardi; +Cc: linux-nvme, sagi, hch, kbusch
Thanks,
applіed to nvme-5.16.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-11-23 16:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 14:16 [PATCH] nvme-host: prevent nvme-cli from setting invalid fast_io_fail_tmo values Maurizio Lombardi
2021-11-14 10:32 ` Sagi Grimberg
2021-11-18 1:44 ` Chaitanya Kulkarni
2021-11-23 16:23 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.