mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Yingjie Wang <1075151112@qq.com>
Cc: linux-nvme@lists.infradead.org, axboe@kernel.dk, hch@lst.de,
	sagi@grimberg.me, kch@nvidia.com, hare@suse.de, corbet@lwn.net,
	skhan@linuxfoundation.org, rdunlap@infradead.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/2] nvme-tcp: validate TLS handshake timeout parameters
Date: Wed, 28 Oct 2026 09:33:01 -0600	[thread overview]
Message-ID: <auIVrTJVjWk8rvNc@kbusch-mbp> (raw)
In-Reply-To: <tencent_8B4F08A2DD4BB093ED7FAECFFD20272B3C07@qq.com>

On Wed, Oct 28, 2026 at 07:57:18PM +0800, Yingjie Wang wrote:
> The NVMe/TCP host and target expose writable tls_handshake_timeout
> parameters as signed integers. Both paths multiply the value by
> MSEC_PER_SEC and HZ before converting the results to unsigned timeout
> types. Large positive and negative values can therefore give the
> handshake agent and the kernel different, unintended timeouts.
> 
> On an HZ=1000 kernel, setting the parameter to 2147484 overflows both
> multiplications. On the target, an accepted pending request can queue the
> timeout work on the next timer-wheel advance while the handshake agent
> was given about 24.9 days. On the host, schedule_timeout() can report a
> wrong timeout value with a stack dump and fail the handshake immediately.
> 
> Make each parameter unsigned and reject values that do not fit both the
> handshake agent's millisecond field and a safe jiffies delay. Read the
> parameter once per handshake so the two timeout mechanisms use the same
> value. Also keep the host completion-wait result in a long: a successful
> wait can return more than INT_MAX remaining jiffies for an accepted
> timeout.

Thanks, applied to nvme-7.4.

      reply	other threads:[~2026-10-28 15:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 11:57 Yingjie Wang
2026-10-28 15:33 ` Keith Busch [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auIVrTJVjWk8rvNc@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=1075151112@qq.com \
    --cc=axboe@kernel.dk \
    --cc=corbet@lwn.net \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=sagi@grimberg.me \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®