[PATCH 1/6] nvme: reject a reconnect_delay of 0 through sysfs
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Nov 5 18:09:01 PST 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] nvme: incorrect Fixes tag for nvme_ctrl_reconnect_delay_store() fix
--
commit b125e1489e83edb63c16621248dd345277c89cc1
Author: Guixin Liu <kanie at linux.alibaba.com>
nvme: reject a reconnect_delay of 0 through sysfs
This commit updates nvme_ctrl_reconnect_delay_store() in
drivers/nvme/host/sysfs.c to reject a reconnect_delay value of 0,
preventing a division by zero in nvme_ctrl_loss_tmo_store().
> nvme: reject a reconnect_delay of 0 through sysfs
>
> 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>
[Severity: Low]
Commit 42a45274c2258 ("nvme-fabrics: Allow ctrl loss timeout configuration")
only added ctrl_loss_tmo option parsing in nvmf_parse_options() in
drivers/nvme/host/fabrics.c, where a reconnect_delay <= 0 was already
rejected.
The sysfs store handlers nvme_ctrl_reconnect_delay_store() and
nvme_ctrl_loss_tmo_store() (later moved to drivers/nvme/host/sysfs.c in
commit 942e21c042e6) were introduced in commit 764075fdcb2f ("nvme: expose
reconnect_delay and ctrl_loss_tmo via sysfs").
Should the Fixes tag reference that commit instead:
Fixes: 764075fdcb2f ("nvme: expose reconnect_delay and ctrl_loss_tmo via sysfs")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106015842.3534898-1-kanie@linux.alibaba.com?part=1
More information about the Linux-nvme
mailing list