From nobody Fri Dec 26 15:43:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dd8zW6w4dz6Llr1 for ; Fri, 26 Dec 2025 15:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dd8zW3Hs1z43W0 for ; Fri, 26 Dec 2025 15:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766763831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vvbAHF2Bshe5WSzNvQ6wsWyrScOyvOq7NnaV+01sR4A=; b=QSyxIlA7vrUhjuJDM8IqCV2yPOaei53rHJzVbIM5cVf22j1+nO8v4pA5FzSidCIu+5G6EB yWR6hXFBHicIH55vW/Kr94FuPfAjY7HM8856VyIkVrBbDnzyGk+wviFwP4gnDsGi8jGgnh EZ6zW+fzIZxieSM5Sv2HDI740l+TxC+ecwvVakrZd9cZbFUugQbeZRp48zZdeEhchlioca uW+Xp61RVRfo13Oj2wYulAEDHLuJcCx96XOCTEismalW21XL0UnlZVWEDDfaoYXbAQ3ySm tF1HzyoH0k6iRHZo/8Cqqu2EJQ1Ay9Qtte23ahIRWAiguHH4eHDoA5B8+yFtng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766763831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vvbAHF2Bshe5WSzNvQ6wsWyrScOyvOq7NnaV+01sR4A=; b=wY3S3NEMKmvRCbg1AYSa8L++I1ZO4LEBGbLsuS9oku/Ap86FnN821lHr8LHCpGvCLg7xPx 6hAPLAkcCf9ddGqMT7rm++hJ04dbnE9p0lHezLiFZuTz+swIbYGFrHagtNM/6t6VJD1Cdy cVQ3tzYzJ6Sd0RjLzmA9GpPi4c1YewzQ63Wblje4ltLB/T90N5XyhUb8dtX7Pl1Cgo87z4 sLxhyQuuxzsJe8+6B3KrJ9Qsq0b3wRllcNjBRmq512yJCHo30+v8IrQxbW5XV4fHrpHIoI njvyp+gAe9WobjlLIs76jLJ9ulsyDO9+zO85yxUJdtf1FI5YmBLgTiTdHhBeFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766763831; a=rsa-sha256; cv=none; b=AVVld+a8/YKG54Uo7VnqjM0BxOq/ijnZq64XPQAZOg80a/Q/Dy32ZP/JVu0VrSQnsyuVi2 WKd7LgeTdSHWoJxuYI9CH0DuVw9oaFdlI6PkkwPrR/+pDsFtJRmQ4Uy8KXoELVsedNMR0D ZHNeLs2Mqk946EYrGXMBhrUaURhsT+ubkMbKmnLcDt9yBSiayNVjeWLm9/WJ4l3sLxH3g1 MoylhikUXLPczvgoONDJRvUpEpA2EDoG8vVm170yOjBD3GdAYf6/UMZTpFvk/jdCDEcOy1 N2NOSHpFgv40XAkoveGJiYFNprx0r8E2gBipk3dAX0IvM8gekm7HbuGwvfGdzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dd8zW2mPNz43L for ; Fri, 26 Dec 2025 15:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id cd8f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 26 Dec 2025 15:43:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 4eb560faa725 - main - acpi: Reject duplicate handlers for ioctl commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4eb560faa725771e536a850a9467fbb592ab3c1b Auto-Submitted: auto-generated Date: Fri, 26 Dec 2025 15:43:51 +0000 Message-Id: <694ead37.cd8f.21db4335@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4eb560faa725771e536a850a9467fbb592ab3c1b commit 4eb560faa725771e536a850a9467fbb592ab3c1b Author: John Baldwin AuthorDate: 2025-12-26 15:36:38 +0000 Commit: John Baldwin CommitDate: 2025-12-26 15:36:38 +0000 acpi: Reject duplicate handlers for ioctl commands Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54311 --- sys/dev/acpica/acpi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 0549c83ded79..e49d3b4d1637 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -4203,7 +4203,7 @@ static int acpi_ioctl_hooks_initted; int acpi_register_ioctl(u_long cmd, acpi_ioctl_fn fn, void *arg) { - struct acpi_ioctl_hook *hp; + struct acpi_ioctl_hook *hp, *thp; if ((hp = malloc(sizeof(*hp), M_ACPIDEV, M_NOWAIT)) == NULL) return (ENOMEM); @@ -4216,6 +4216,14 @@ acpi_register_ioctl(u_long cmd, acpi_ioctl_fn fn, void *arg) TAILQ_INIT(&acpi_ioctl_hooks); acpi_ioctl_hooks_initted = 1; } + TAILQ_FOREACH(thp, &acpi_ioctl_hooks, link) { + if (thp->cmd == cmd) { + ACPI_UNLOCK(acpi); + free(hp, M_ACPIDEV); + return (EBUSY); + } + } + TAILQ_INSERT_TAIL(&acpi_ioctl_hooks, hp, link); ACPI_UNLOCK(acpi);