summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-08-06 11:34:40 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-08-06 11:34:40 +0000
commit917cee0d014d2e42d3dcada785a76c0ad868515a (patch)
treee4f41f830eee4ac8b921882edc596dd7bdfa9614 /usr/src/lib
parent4ff31f76cff40104f343d4135967abf1b00edd66 (diff)
parentbe235d17490f6a5ad01c6a5319530fce66d88389 (diff)
downloadillumos-joyent-917cee0d014d2e42d3dcada785a76c0ad868515a.tar.gz
[illumos-gate merge]
commit be235d17490f6a5ad01c6a5319530fce66d88389 12801 libdiskmgt leaks PROM device information handles like a sieve commit bd05d33960c9701232eaa8bdb6a5ce585912ffc6 13016 bhyve cannot emulate MMIO from bootrom commit 2c834067bf731e663c6269489bf5dc0a9b4c6299 12977 smb3 server encryption leak in smb2_send_reply commit fe417ad0efdf365d5438ae46904118fa27ae38b8 12853 bhyve manifests should include BSD license commit 1a10a9077a9effc574b7f797a4d321dd0cea4197 12419 intel_nb5000: variable may be used uninitialized
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/libdiskmgt/common/findevs.c30
-rw-r--r--usr/src/lib/libvmmapi/THIRDPARTYLICENSE26
-rw-r--r--usr/src/lib/libvmmapi/THIRDPARTYLICENSE.descrip1
3 files changed, 53 insertions, 4 deletions
diff --git a/usr/src/lib/libdiskmgt/common/findevs.c b/usr/src/lib/libdiskmgt/common/findevs.c
index 2ac0e6cada..53a0b121fb 100644
--- a/usr/src/lib/libdiskmgt/common/findevs.c
+++ b/usr/src/lib/libdiskmgt/common/findevs.c
@@ -28,6 +28,7 @@
* Copyright (c) 2011 by Delphix. All rights reserved.
* Copyright 2017 Nexenta Systems, Inc.
* Copyright 2017 Joyent, Inc.
+ * Copyright 2020 Oxide Computer Company
*/
#include <fcntl.h>
@@ -151,8 +152,23 @@ findevs(struct search_args *args)
args->controller_listp = NULL;
args->disk_listp = NULL;
+ args->ph = DI_PROM_HANDLE_NIL;
+ args->handle = DI_LINK_NIL;
args->dev_walk_status = 0;
- args->handle = di_devlink_init(NULL, 0);
+
+ /*
+ * Create device information library handles, which must be destroyed
+ * before we return.
+ */
+ if ((args->ph = di_prom_init()) == DI_PROM_HANDLE_NIL ||
+ (args->handle = di_devlink_init(NULL, 0)) == DI_LINK_NIL) {
+ /*
+ * We could not open all of the handles we need, so clean up
+ * and report failure to the caller.
+ */
+ args->dev_walk_status = errno;
+ goto cleanup;
+ }
/*
* Have to make several passes at this with the new devfs caching.
@@ -160,7 +176,6 @@ findevs(struct search_args *args)
* devices.
*/
di_root = di_init("/", DINFOCACHE);
- args->ph = di_prom_init();
(void) di_walk_minor(di_root, NULL, 0, args, add_devs);
di_fini(di_root);
@@ -168,9 +183,16 @@ findevs(struct search_args *args)
(void) di_walk_minor(di_root, NULL, 0, args, add_devs);
di_fini(di_root);
- (void) di_devlink_fini(&(args->handle));
-
clean_paths(args);
+
+cleanup:
+ if (args->ph != DI_PROM_HANDLE_NIL) {
+ di_prom_fini(args->ph);
+ args->ph = DI_PROM_HANDLE_NIL;
+ }
+ if (args->handle != DI_LINK_NIL) {
+ (void) di_devlink_fini(&(args->handle));
+ }
}
/*
diff --git a/usr/src/lib/libvmmapi/THIRDPARTYLICENSE b/usr/src/lib/libvmmapi/THIRDPARTYLICENSE
new file mode 100644
index 0000000000..66b39dc950
--- /dev/null
+++ b/usr/src/lib/libvmmapi/THIRDPARTYLICENSE
@@ -0,0 +1,26 @@
+
+SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+
+Copyright (c) 1992-2020 The FreeBSD Project.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
diff --git a/usr/src/lib/libvmmapi/THIRDPARTYLICENSE.descrip b/usr/src/lib/libvmmapi/THIRDPARTYLICENSE.descrip
new file mode 100644
index 0000000000..77026fc8a3
--- /dev/null
+++ b/usr/src/lib/libvmmapi/THIRDPARTYLICENSE.descrip
@@ -0,0 +1 @@
+Bhyve hypervisor