Re: [PATCH] devpts: fix pty count limit off by one

Greg KH <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.serial
Message-ID <2026080419-chatting-curve-e49c@gregkh>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.