summaryrefslogtreecommitdiffstats
path: root/module/nvpair
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2017-04-03 09:47:11 -0700
committerBrian Behlendorf <[email protected]>2017-08-30 11:50:12 -0700
commit006309e8d75b22efc7418095e408b3b3774ef8ea (patch)
tree0ae4ea43e2b8c4f40a82cd9621d07e34b51912be /module/nvpair
parent1ea8942faa90c1787f3ad1bda44dc26bfc3186da (diff)
OpenZFS 8375 - Kernel memory leak in nvpair code
Authored by: Matthew Ahrens <[email protected]> Reviewed by: Pavel Zakharov <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Prashanth Sreenivasa <[email protected]> Reviewed by: Robert Mustacchi <[email protected]> Approved by: Dan McDonald <[email protected]> Reviewed-by: Don Brady <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: Giuseppe Di Natale <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/8375 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/843c211 Closes #6578
Diffstat (limited to 'module/nvpair')
-rw-r--r--module/nvpair/nvpair.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/module/nvpair/nvpair.c b/module/nvpair/nvpair.c
index 2e3820981..8e654053c 100644
--- a/module/nvpair/nvpair.c
+++ b/module/nvpair/nvpair.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2015, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2015, 2017 by Delphix. All rights reserved.
*/
#include <sys/stropts.h>
@@ -2200,8 +2200,10 @@ nvs_embedded(nvstream_t *nvs, nvlist_t *embedded)
nvlist_init(embedded, embedded->nvl_nvflag, priv);
- if (nvs->nvs_recursion >= nvpair_max_recursion)
+ if (nvs->nvs_recursion >= nvpair_max_recursion) {
+ nvlist_free(embedded);
return (EINVAL);
+ }
nvs->nvs_recursion++;
if ((err = nvs_operation(nvs, embedded, NULL)) != 0)
nvlist_free(embedded);