Re: [PATCH] devpts: reject max=0 instead of silently lifting the limit

From: Greg KH

Date: Thu Sep 03 2026 - 00:36:07 EST


On Thu, Sep 03, 2026 at 11:36:25AM +0800, Tao Cui wrote:
> From: Tao Cui <cuitao@xxxxxxxxxx>
>
> 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