Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Aug 2018 01:30:04 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337221 - head/sys/cddl/contrib/opensolaris/common/nvpair
Message-ID:  <201808030130.w731U46d076213@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Aug  3 01:30:03 2018
New Revision: 337221
URL: https://svnweb.freebsd.org/changeset/base/337221

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

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

Modified: head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c	Fri Aug  3 01:28:11 2018	(r337220)
+++ head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c	Fri Aug  3 01:30:03 2018	(r337221)
@@ -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);



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