[PATCH v2 1/5] nvme: reject a reconnect_delay of 0 through sysfs
Keith Busch
kbusch at kernel.org
Mon Nov 9 09:54:55 PST 2026
On Mon, Nov 09, 2026 at 10:26:42AM +0800, Guixin Liu wrote:
> nvme_ctrl_reconnect_delay_store() accepts any value the option parser
> also accepts, except that it misses the lower bound: writing 0 is
> rejected by nvmf_parse_options() but not by the sysfs attribute.
> nvme_ctrl_loss_tmo_store() then divides by opts->reconnect_delay in
> DIV_ROUND_UP(), so writing 0 followed by any ctrl_loss_tmo update
> crashes the kernel with a division by zero.
>
> Reject 0 like the option parser does.
There was another patch sent earlier with an identical fix posted here:
https://lore.kernel.org/linux-nvme/20261105215807526OqR0Bg86VChvwhCEz5xGr@zte.com.cn/
I ended up applying the one that published first, but removed the
unnecessary code comments.
More information about the Linux-nvme
mailing list