From nobody Fri Jan 20 17:59:58 2023 X-Original-To: virtualization@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 4Nz6ht312gz2t8Yn for ; Fri, 20 Jan 2023 17:59:58 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz6ht0yfRz4Lbr for ; Fri, 20 Jan 2023 17:59:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674237598; 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: in-reply-to:in-reply-to:references:references; bh=yAXh8GC3p/G1DrUD/uSuyNdbZH80l8FY8qCcCFjSGEo=; b=N/VHJYt37IGM9G/sA2PKEWBCKnh9unNBwBRz8iwPeWFtXXAea3s88pHkrD0Z42ZCqkhFhe L8DIS3XLzEomncMUj9a1zUYZQuHgZwbJU9/iZz3kVjUduKskhHcXy8Y8nGVd15cNtnjL3Z fczOmPRAoQxtxGtM9/kD7KSStdXnrGRe4ZuTxNnrxWWiW2zOaQ1DSVR0e2/OG/HdYdLMxn 6e/3A6PAkGq56isEJcEz8KdARSo7xj1F1PUx0SmFHX2SFOvyaHutDhNo1u+YwEHYCIKyxT aGd4oO5PChJZ9kqa4pkqQUKorwD1JCx25xrw0IxKh9APprYSdoNbZwc3nhy0lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674237598; a=rsa-sha256; cv=none; b=C+U3LokJdUwjz9t4ONCIUhKgda59MmR6kktBWebUd3PD3OqOkOuPO+ma5zwFiLVK46EsfR 5qBsfgWQlgv9H6caNy5Haki94loSl5MVVu8Y+YxvWAXdykKMMD7j1CiDRBq+cU3NFRRGid BoLo81nIpC/YCbl/XQus3Vlgv3gr7zRBceGX3bV2IuSYDG37dafuaZB22htu6+/Rdxwr5B QhXzX+enIItKPyQXnxzsDnVbf0PBBCZvXpNX7Xc2VkPSfUxebz5kYMPju4jOIaODydUOV+ yp6HQGMQ2qeniqNUcZYsA4wdkck+YIRI/7R0+HjrLis1NACJek8UTC7EFI9x+A== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nz6ht02zRzfH2 for ; Fri, 20 Jan 2023 17:59:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 30KHxvaV051399 for ; Fri, 20 Jan 2023 17:59:57 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 30KHxvdx051398 for virtualization@FreeBSD.org; Fri, 20 Jan 2023 17:59:57 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 264582] bhyve: hda_send_command() can index beyond the end of sc->codecs[] Date: Fri, 20 Jan 2023 17:59:58 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bhyve X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: needs-patch, needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: virtualization@FreeBSD.org X-Bugzilla-Flags: mfc-stable13? mfc-stable12? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264582 --- Comment #1 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Dcf57f20edcf9c75f0f9f1ac1c44729184= 970b9d9 commit cf57f20edcf9c75f0f9f1ac1c44729184970b9d9 Author: John Baldwin AuthorDate: 2023-01-20 17:58:38 +0000 Commit: John Baldwin CommitDate: 2023-01-20 17:58:38 +0000 bhyve: Fix a buffer overread in the PCI hda device model. The sc->codecs array contains HDA_CODEC_MAX (15) entries. The guest-supplied cad field in the verb provided to hda_send_command is a 4-bit field that was used as an index into sc->codecs without any bounds checking. The highest value (15) would overflow the array. Other uses of sc->codecs in the device model used sc->codecs_no to determine which array indices have been initialized, so use a similar check to reject requests for uninitialized or invalid cad indices in hda_send_command. PR: 264582 Reported by: Robert Morris Reviewed by: corvink, markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38128 usr.sbin/bhyve/pci_hda.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=