[PATCH 1/6] nvme: reject a reconnect_delay of 0 through sysfs

Christoph Hellwig hch at lst.de
Fri Nov 6 02:33:39 PST 2026


On Fri, Nov 06, 2026 at 09:58:37AM +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.
> 
> Fixes: 42a45274c2258 ("nvme-fabrics: Allow ctrl loss timeout configuration")
> Cc: stable at vger.kernel.org
> Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>

I think the Sashiko nit about the fixes tag is correct.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch at lst.de>




More information about the Linux-nvme mailing list