From nobody Tue Jun 07 15:21:36 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 D0BCA7FB1A3 for ; Tue, 7 Jun 2022 15:21:36 +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 4LHYww3Zhxz4Yvs for ; Tue, 7 Jun 2022 15:21:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 5B6D81D903 for ; Tue, 7 Jun 2022 15:21:36 +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 257FLacB033069 for ; Tue, 7 Jun 2022 15:21:36 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 257FLavM033068 for virtualization@FreeBSD.org; Tue, 7 Jun 2022 15:21:36 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 264521] bhyve's pci_vtscsi_request_handle() can read beyond allocated heap object Date: Tue, 07 Jun 2022 15:21:36 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bhyve X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rtm@lcs.mit.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: virtualization@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654615296; 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=DyGH3jHFUSrPgsIK4ZEoN3UOoQfmmLw4fGkxqXgsTys=; b=N9T43BdV7R/WldsJxpsPRcsSPAtcQW1PM67mYv3sn8LX1DATwm0Ue5yrEcu2FjjLDvZqZ1 1xi/SFSDlY1wMET4rZsRbnUKrLYEtwa0jH+To0ysrfavibpaM838af2ob63bp3ftuBfEdi ZoNf6kHVywM5Q9KdiAXk/tMwUG5Jag9M0SqJCoel7cz3b98nj6nvUDo5uVFWebzCR4zF1+ JzMDXwZ6Wx+xUCSmADnf5iFeILuUw6Mk8Rww4n/nYELesLNIAb/W0JX0WRbwYBK/ZGq6MX ZxeRb4tgFaGAlXVu/sOPsXeVnaoBLm1cdpikshrPDuR6FrKLPzHdRHOHN4B1pA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654615296; a=rsa-sha256; cv=none; b=BdUTGQJ1fDVigfcUPx3m+RnGy7DDeyjDvmbCzLsfYdotu95KVAvoLKbrCn52xSQZRWWnE6 d1wC0Zd92bcsXdqUsiTT4z+xWyZtFhI2Xn0cV8Y1aTh8+dV4tS6HO1DPz884QxJAzxKRJj DaleeIc0MR7OGhzuZH1YBDlqn08PRjq1c5LEbVM2bWbRKRbhibXdhoI2DBNMzb+2uwQpap 38ZJ2bQs/JnAN7frGvPKxA7TwNRu8aze3Puj4cECLofkT+PoVehDs2IEZ3R+3RoJ9+lxRy znAkF4Dz8MZnbyb2NaNu8H7WwFS9jS7JvJboH7kNzXSCZh+qmQ2kmfWD2GLSjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264521 Bug ID: 264521 Summary: bhyve's pci_vtscsi_request_handle() can read beyond allocated heap object Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bhyve Assignee: virtualization@FreeBSD.org Reporter: rtm@lcs.mit.edu Bhyve's pci_vtscsi_request_handle() says: iov_to_buf(iov_in, niov_in, (void **)&cmd_rd); ...; io->io_hdr.nexus.targ_lun =3D pci_vtscsi_get_lun(cmd_rd->lun); // and further uses of cmd_rd If the guest driver provided no readable virtio descriptors, then niov_in will be zero, and iov_to_buf() will cause cmd_rd to point to a zero-length heap object. If there is a readable descriptor, but it's smaller than sizeof(cmd_rd), there's also a problem. --=20 You are receiving this mail because: You are the assignee for the bug.=