All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tao Cui <cui.tao@linux.dev>
Cc: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk,
	brauner@kernel.org, jack@suse.cz, linux-kernel@vger.kernel.org,
	lxc-devel@lists.linuxcontainers.org, Tao Cui <cuitao@kylinos.cn>
Subject: Re: [PATCH] devpts: reject max=0 instead of silently lifting the limit
Date: Thu, 3 Sep 2026 06:33:06 +0200	[thread overview]
Message-ID: <2026090337-crowbar-unable-24b0@gregkh> (raw)
In-Reply-To: <20260903033625.1042796-1-cui.tao@linux.dev>

On Thu, Sep 03, 2026 at 11:36:25AM +0800, Tao Cui wrote:
> From: Tao Cui <cuitao@kylinos.cn>
> 
> mount_opts.max == 0 is consumed as ida_alloc_max(..., max - 1), which
> wraps to 0xffffffff.  The IDA layer treats a negative max as INT_MAX,
> so "mount -t devpts -o max=0" does not disable ptys - it lifts the
> per-instance limit entirely and only the global kernel.pty.max still
> applies.
> 
> Reject the value at parse time:
> 
>   $ mount -t devpts -o max=0 pt /tmp/pt
>   mount: /tmp/pt: wrong fs type, bad option, bad superblock...
> 
> No userspace relies on 0 meaning "unlimited": runc and crun never
> set max=, and LXC, the only runtime that does, omits the property
> entirely when the configured value is 0.
> 
> The value has never been validated since the option was introduced,
> so there is no Fixes tag.

Shouldn't the Fixes tag be where the option was introduced?

Anyway, not all that big of a deal as this is a root-only thing.

thanks,

greg k-h

  reply	other threads:[~2026-09-03  4:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  3:36 [PATCH] devpts: reject max=0 instead of silently lifting the limit Tao Cui
2026-09-03  4:33 ` Greg KH [this message]
2026-09-04 10:57 ` Christian Brauner

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=2026090337-crowbar-unable-24b0@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=brauner@kernel.org \
    --cc=cui.tao@linux.dev \
    --cc=cuitao@kylinos.cn \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lxc-devel@lists.linuxcontainers.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.