NetBSD Problem Report #60564
From www@netbsd.org Sun Aug 9 22:27:12 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.netbsd.org", Issuer "YR2" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id A23C51A923B
for <gnats-bugs@gnats.NetBSD.org>; Sun, 9 Aug 2026 22:27:12 +0000 (UTC)
Message-Id: <20260809222711.B336D1A9246@mollari.NetBSD.org>
Date: Sun, 9 Aug 2026 22:27:11 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: live image has legacy pty /dev nodes despite using ptyfs
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>
>Number: 60564
>Category: misc
>Synopsis: live image has legacy pty /dev nodes despite using ptyfs
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: misc-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Aug 09 22:30:00 +0000 2026
>Last-Modified: Mon Aug 10 06:05:00 +0000 2026
>Originator: Taylor R Campbell
>Release: current, 11, 10, 9, ...
>Organization:
The NetBSD Livedation, Pty.
>Environment:
>Description:
Every image that uses common/bootimage/Makefile.bootimage has
legacy pty nodes unconditionally, even if it mounts ptyfs
anyway:
465 ${HOST_SH} ${WORKDIR}/dev/MAKEDEV -s all ipty | \
https://nxr.netbsd.org/xref/src/distrib/common/bootimage/Makefile.bootimage?r=1.50#465
This is used by the live image on various architectures, even
though they also mount ptyfs.
Perhaps it is reasonable to use legacy pty nodes in installer
images though I suspect it would be better to just mount ptyfs.
I seem to recall the legacy pty nodes have security issues
(though I forget what they are -- should document them in the
pty(4) man page) and cause trouble of various kinds.
>How-To-Repeat:
image inspection
>Fix:
1. Make a parameter for Makefile.bootimage for the set of
MAKEDEV targets.
2. Add the ipty target only where it is actually needed.
3. Make sure ttyp0 and ttyp1 don't exist in the live images
that mount ptyfs.
>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: misc/60564: live image has legacy pty /dev nodes despite using
ptyfs
Date: Mon, 10 Aug 2026 08:00:12 +0200
On Sun, Aug 09, 2026 at 10:30:00PM +0000, campbell+netbsd@mumble.net via gnats wrote:
> Perhaps it is reasonable to use legacy pty nodes in installer
> images though I suspect it would be better to just mount ptyfs.
We don't always have mount_ptyfs(8) available in those images.
> I seem to recall the legacy pty nodes have security issues
> (though I forget what they are -- should document them in the
> pty(4) man page) and cause trouble of various kinds.
Yes, but only in multi user mode, so hardly an issue on install images.
But I agree that USB and full CD images should prefer ptyfs over legacy
pty nodes. Also the tmpfs /dev created by init if it does not find a
working /dev/console should be ptyfs based (maybe by making MAKEDEV
a bit smarter and e.g. check if /sbin/mount_ptyfs exists?)
Martin
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.