Skip to contentSkip to conversation

nvme-host: prevent nvme-cli from setting invalid fast_io_fail_tmo values

PATCH In review Maurizio Lombardi 4 participants 4 messages Nov 12, 2021 – Nov 23, 2021 NVMe

lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/nvme/host/fabrics.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/nvme/host/fabrics.c +3 -0
index c5a2b71c5268..282d54117e0a 100644
@@ -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