mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: Hungyu Lin <dennylin0707@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] pps: reject N_PPS on pseudo-terminals
Date: Wed, 11 Nov 2026 14:50:12 +0100	[thread overview]
Message-ID: <e73c9835-f17d-409f-bb9a-365212823c1e@enneenne.com> (raw)
In-Reply-To: <20261111132709.5959-1-dennylin0707@gmail.com>

On 11/11/2026 14:27, Hungyu Lin wrote:
> Attaching N_PPS to a PTY registers a PPS source even though PTYs do not
> report DCD changes. An unprivileged user can exhaust the PPS source IDs
> this way, causing registration of a real PPS source to fail with
> -EBUSY.
> 
> Reject N_PPS on PTYs before allocating a source.
> 
> Fixes: a0880df0ccde ("pps: serial clients support")
> Suggested-by: Rodolfo Giometti <giometti@enneenne.com>
> Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
> ---
> Changes in v2:
> - Reject PTYs before registering a PPS source, as suggested by Rodolfo.
> - Drop the stable Cc.
> 
> v1: https://lore.kernel.org/r/20261107211753.75932-1-dennylin0707@gmail.com
> 
>  drivers/pps/clients/pps-ldisc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/pps/clients/pps-ldisc.c b/drivers/pps/clients/pps-ldisc.c
> index fa5660f3c4b7..83f4caced0c9 100644
> --- a/drivers/pps/clients/pps-ldisc.c
> +++ b/drivers/pps/clients/pps-ldisc.c
> @@ -46,6 +46,9 @@ static int pps_tty_open(struct tty_struct *tty)
>  	struct pps_device *pps;
>  	int ret;
>  
> +	if (drv->type == TTY_DRIVER_TYPE_PTY)
> +		return -EINVAL;
> +
>  	info.owner = THIS_MODULE;
>  	info.dev = NULL;
>  	snprintf(info.name, PPS_MAX_NAME_LEN, "%s%d", drv->driver_name, index);

Acked-by: Rodolfo Giometti <giometti@enneenne.com>

-- 
GNU/Linux Solutions                  e-mail: giometti@enneenne.com
Linux Device Driver                          giometti@linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming

      reply	other threads:[~2026-11-11 13:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 13:27 Hungyu Lin
2026-11-11 13:50 ` Rodolfo Giometti [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=e73c9835-f17d-409f-bb9a-365212823c1e@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=akpm@linux-foundation.org \
    --cc=dennylin0707@gmail.com \
    --cc=linux-kernel@vger.kernel.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®