From nobody Sat Nov 19 17:49:15 2022 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 4NF1P73jR3z4hSgv for ; Sat, 19 Nov 2022 17:49:15 +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 4NF1P72WpVz44TY for ; Sat, 19 Nov 2022 17:49:15 +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=1668880155; 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=CLZRK/AMRCZCtFOkgB/arChyDzdpAGZ+yNJNfVM2vE8=; b=jmvB088ftDAOBPErO4OPSWDf7etrIoDHtvhObmJ4Zlkm8Cf7lnZKxIqesOpqeZAAEpt9H2 UCLgQb/ecFOgwZa2AbT+S4B5JO9maqjou6c4nBO42xIXXXSuvJIl5LMIyIdaUh9LBHbPII ojJwz0DfZoQSYRAyFvA2Hd40u5BiJJnAr9S2CryV+eUTBKYjQ55XihbMkrQGH55oU4at78 G9FiGnXVImhDiy6xRweHIDDkAI7yBdphrEMO1XHGrrorvgR+AeQE7CiLm5kgZ1vmdZr9mh NgVEe1aEyYmMR1TrrexpV8asG+i42TCu+U7wU/nQoBk9Es/DpPWiAKB/Dhnl9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668880155; a=rsa-sha256; cv=none; b=Qo4ELtThGLXdLAsgeztNOovaJUXZM8aqwZCMgBAqH0DfIP8Szts8Z0axm1B8fH/iMDhGm3 rvLPmBjWJzRKU50JZpoz2Lm3blrXkycnp59tTwvJT3ORu9no6cr3p6IaMW5ncVeCO+8K39 NyYA/aIqugRucxHrBCj5jFqY+WPganmhmRykEKRIFqENGQQsMy59fxBMfi0R/khKeLilMG HtyNh+ZqwxtI7FifWbJ41EeTHxU+3bIJDMvS+wnNbf3DrEnzeZMK9QvQvz2Wvsn9ZgH3nr RJXOjM0J9TTCvRshS+G/rkyLrMa3ln3xC7uiy0PRTZLzgcJ4eZ7bQbkWpdheGA== 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 4NF1P71695ztTb for ; Sat, 19 Nov 2022 17:49:15 +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 2AJHnFkK010417 for ; Sat, 19 Nov 2022 17:49:15 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2AJHnFon010416 for virtualization@FreeBSD.org; Sat, 19 Nov 2022 17:49:15 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 264177] bhyve: Guest can cause a crash in bhyve nvme emulation Date: Sat, 19 Nov 2022 17:49:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bhyve X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: chuck@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? maintainer-feedback+ 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=3D264177 --- Comment #6 from commit-hook@FreeBSD.org --- A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Da00b97054a504792eb6fa028728726f5c= 37744c3 commit a00b97054a504792eb6fa028728726f5c37744c3 Author: Chuck Tuffli AuthorDate: 2022-06-09 18:19:32 +0000 Commit: Chuck Tuffli CommitDate: 2022-11-20 01:48:45 +0000 bhyve nvme: Fix out-of-bound IOV array access Summary: NVMe operations indicate the memory region(s) associated with a command via physical region pages (PRPs). Since each PRP has a fixed size, contiguous memory regions larger than the PRP size require multiple PRP entries. Instead of issuing a blockif call for each PRP, the NVMe emulation concatenates multiple contiguous PRP entries into a single blockif request. The test for contiguous regions has a bug such that it mistakenly treats an initial PRP address of zero as a contiguous range and concatenates it with the previous. But because there is no previous IOV, the concatenation code corrupts the IO request structure and leads to a segmentation fault when the blockif request completes. Fix is to test for the existence of a previous range before trying to concatenate the current range with the previous one. While in the area, rename pci_nvme_append_iov_req()'s lba parameter to offset to match its usage. PR: 264177 (cherry picked from commit 88951aaaee73b87121b0f121224fe188a5b5e6e3) usr.sbin/bhyve/pci_nvme.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) --=20 You are receiving this mail because: You are on the CC list for the bug.=