Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Aug 2021 22:14:20 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b1a2ffd650c0 - stable/13 - bhyve: Gracefully handle virtio-scsi with no conf
Message-ID:  <202108112214.17BMEKmk013954@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=b1a2ffd650c0b85d7df97d61869d7e598b81f477

commit b1a2ffd650c0b85d7df97d61869d7e598b81f477
Author:     Ryan Moeller <freqlabs@FreeBSD.org>
AuthorDate: 2021-04-22 16:06:08 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2021-08-11 22:13:00 +0000

    bhyve: Gracefully handle virtio-scsi with no conf
    
    Fixes segfault with the command `bhyve -s 0,virtio-scsi`, which is used
    by some third party software to probe bhyve for virtio-scsi support.
    
    Reviewed by:    jhb
    MFC after:      1 day
    Sponsored by:   iXsystems, Inc.
    Differential Revision:  https://reviews.freebsd.org/D29926
    
    (cherry picked from commit 89c3c32647a5099b297af2958e5a939eff0c0ce0)
---
 usr.sbin/bhyve/pci_virtio_scsi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/usr.sbin/bhyve/pci_virtio_scsi.c b/usr.sbin/bhyve/pci_virtio_scsi.c
index 8314b4afce38..33cf67bef12c 100644
--- a/usr.sbin/bhyve/pci_virtio_scsi.c
+++ b/usr.sbin/bhyve/pci_virtio_scsi.c
@@ -670,6 +670,9 @@ pci_vtscsi_legacy_config(nvlist_t *nvl, const char *opts)
 {
 	char *cp, *devname;
 
+	if (opts == NULL)
+		return (0);
+
 	cp = strchr(opts, ',');
 	if (cp == NULL) {
 		set_config_value_node(nvl, "dev", opts);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108112214.17BMEKmk013954>