svn commit: r339145 - stable/11/sys/cddl/contrib/opensolaris/common/nvpair

Alexander Motin mav at FreeBSD.org
Wed Oct 3 14:58:29 UTC 2018


Author: mav
Date: Wed Oct  3 14:58:28 2018
New Revision: 339145
URL: https://svnweb.freebsd.org/changeset/base/339145

Log:
  MFC r337221: MFV r337220: 8375 Kernel memory leak in nvpair code
  
  illumos/illumos-gate at 843c2111b160463f014d325560ad4b051711928e
  
  Reviewed by: Pavel Zakharov <pavel.zakharov at delphix.com>
  Reviewed by: George Wilson <george.wilson at delphix.com>
  Reviewed by: Prashanth Sreenivasa <pks at delphix.com>
  Reviewed by: Robert Mustacchi <rm at joyent.com>
  Approved by: Dan McDonald <danmcd at joyent.com>
  Author: Matthew Ahrens <mahrens at delphix.com>

Modified:
  stable/11/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c	Wed Oct  3 14:57:54 2018	(r339144)
+++ stable/11/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c	Wed Oct  3 14:58:28 2018	(r339145)
@@ -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/debug.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);


More information about the svn-src-stable-11 mailing list