NetBSD Problem Report #60492

From www@netbsd.org  Thu Jul 23 21:43:38 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) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR2" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8D6B51A923B
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 23 Jul 2026 21:43:38 +0000 (UTC)
Message-Id: <20260723214337.57F911A923C@mollari.NetBSD.org>
Date: Thu, 23 Jul 2026 21:43:37 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: hdaudio(4): setconfig is allowed unprivileged
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>

>Number:         60492
>Category:       kern
>Synopsis:       hdaudio(4): setconfig is allowed unprivileged
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 23 21:45:00 +0000 2026
>Closed-Date:    Fri Aug 07 18:54:45 +0000 2026
>Last-Modified:  Fri Aug 07 18:54:45 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10, 9, ...
>Organization:
The NetBSD Foundaudio, Inconfigured
>Environment:
>Description:

	The ioctl(HDAUDIO_FGRP_SETCONFIG) command is available to
	anyone with any access -- including read-only -- to
	/dev/hdaudioN with no write access checks.

	This can be used to trigger config_detach / config_found, and
	if there are any races in those (which is often the case),
	might be exploitable for local privilege escalation.

	Forwarded to us by Khushali Dalal <kdalal@vulncheck.com>.

>How-To-Repeat:

	1. Build hdaudioctl(8) so that it opens /dev/hdaudioN O_RDONLY
	   instead of O_RDWR.

	2. hdaudioctl set ...

>Fix:

	Add access checks to hdaudioioctl.

>Release-Note:

>Audit-Trail:
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60492 CVS commit: src/sys/dev/hdaudio
Date: Thu, 23 Jul 2026 22:07:44 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Thu Jul 23 22:07:44 UTC 2026

 Modified Files:
 	src/sys/dev/hdaudio: hdaudio.c

 Log Message:
 hdaudio(4): Apply access checks to ioctl routines.

 This way the permissions on /dev/hdaudioN actually do something.

 Sort includes while here.

 PR kern/60492: hdaudio(4): setconfig is allowed unprivileged


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.19 src/sys/dev/hdaudio/hdaudio.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Thu, 23 Jul 2026 22:10:46 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-11, pullup-10, pullup-9


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sat, 25 Jul 2026 19:50:46 +0000
State-Changed-Why:
pullup-11 #396 https://releng.netbsd.org/cgi-bin/req-11.cgi?show=396
pullup-10 #1316 https://releng.netbsd.org/cgi-bin/req-10.cgi?show=1316
pullup-9 #2038 https://releng.netbsd.org/cgi-bin/req-9.cgi?show=2038


From: "Stephen Borrill" <sborrill@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60492 CVS commit: [netbsd-10] src/sys/dev/hdaudio
Date: Tue, 28 Jul 2026 10:27:36 +0000

 Module Name:	src
 Committed By:	sborrill
 Date:		Tue Jul 28 10:27:36 UTC 2026

 Modified Files:
 	src/sys/dev/hdaudio [netbsd-10]: hdaudio.c

 Log Message:
 Pull up the following revisions(s) (requested by riastradh in ticket #1316):
 	sys/dev/hdaudio/hdaudio.c:	revision 1.19

 hdaudio(4): Apply access checks to ioctl commands so that
 unprivileged users without write permission on /dev/hdaudioN can't
 change the configuration.
 PR kern/60492: hdaudio(4): setconfig is allowed unprivileged


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.18.4.1 src/sys/dev/hdaudio/hdaudio.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Stephen Borrill" <sborrill@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60492 CVS commit: [netbsd-9] src/sys/dev/hdaudio
Date: Tue, 28 Jul 2026 10:49:03 +0000

 Module Name:	src
 Committed By:	sborrill
 Date:		Tue Jul 28 10:49:02 UTC 2026

 Modified Files:
 	src/sys/dev/hdaudio [netbsd-9]: hdaudio.c

 Log Message:
 Pull up the following revisions(s) (requested by riastradh in ticket #2038):
 	sys/dev/hdaudio/hdaudio.c:	revision 1.19

 hdaudio(4): Apply access checks to ioctl commands so that
 unprivileged users without write permission on /dev/hdaudioN can't
 change the configuration.
 PR kern/60492: hdaudio(4): setconfig is allowed unprivileged


 To generate a diff of this commit:
 cvs rdiff -u -r1.9.2.2 -r1.9.2.3 src/sys/dev/hdaudio/hdaudio.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60492 CVS commit: [netbsd-11] src/sys/dev/hdaudio
Date: Sun, 2 Aug 2026 13:21:37 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Aug  2 13:21:37 UTC 2026

 Modified Files:
 	src/sys/dev/hdaudio [netbsd-11]: hdaudio.c

 Log Message:
 Pull up following revision(s) (requested by riastradh in ticket #396):

 	sys/dev/hdaudio/hdaudio.c: revision 1.19

 hdaudio(4): Apply access checks to ioctl routines.

 This way the permissions on /dev/hdaudioN actually do something.
 Sort includes while here.

 PR kern/60492: hdaudio(4): setconfig is allowed unprivileged


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.18.12.1 src/sys/dev/hdaudio/hdaudio.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Fri, 07 Aug 2026 18:54:45 +0000
State-Changed-Why:
fixed and pulled up 11, 10, and9


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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.