mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Yichong Chen <chenyichong@uniontech.com>
Cc: jirislaby@kernel.org, viro@zeniv.linux.org.uk,
	willy@infradead.org, kees@kernel.org,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] devpts: fix pty count limit off by one
Date: Tue, 4 Aug 2026 10:40:26 +0200	[thread overview]
Message-ID: <2026080419-chatting-curve-e49c@gregkh> (raw)
In-Reply-To: <20260804082321.884880-1-chenyichong@uniontech.com>

On Tue, Aug 04, 2026 at 04:23:21PM +0800, Yichong Chen wrote:
> devpts_new_index() increments the global pty count before checking it
> against the effective global limit. The check currently rejects a new pty
> when the incremented count is equal to the limit.
> 
> This makes kernel.pty.max allow only max - 1 ptys. For example, if
> kernel.pty.nr is 3 and kernel.pty.max is set to 4, opening /dev/ptmx
> fails with -ENOSPC even though one more pty should be allowed.
> 
> Allow the incremented count to be equal to the effective limit and reject
> only counts above it.
> 
> Fixes: 0f0a0e54a2a1 ("devpts: Convert to new IDA API")

As this is a user-visible change, what is now going to break because of
this?  It's been this way for a very long time now.

thanks,

greg k-h

  reply	other threads:[~2026-08-04  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04  8:23 Yichong Chen
2026-08-04  8:40 ` Greg KH [this message]
2026-08-04  9:52   ` Yichong Chen
2026-08-04 10:06     ` Greg KH

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=2026080419-chatting-curve-e49c@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=chenyichong@uniontech.com \
    --cc=jirislaby@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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®