Author: mav
Date: Fri Aug  3 01:26:07 2018
New Revision: 337219
URL: https://svnweb.freebsd.org/changeset/base/337219

Log:
  MFV r337218: 7261 nvlist code should enforce name length limit
  
  illumos/illumos-gate@48dd5e630c9b1773b7b10d08a3b90b6c9062d713
  
  Reviewed by: Sebastien Roy <sebastien....@delphix.com>
  Reviewed by: George Wilson <george.wil...@delphix.com>
  Reviewed by: Robert Mustacchi <r...@joyent.com>
  Approved by: Dan McDonald <dan...@omniti.com>
  Author: Matthew Ahrens <mahr...@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:17:14 2018        (r337218)
+++ head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c        
Fri Aug  3 01:26:07 2018        (r337219)
@@ -914,6 +914,8 @@ nvlist_add_common(nvlist_t *nvl, const char *name,
 
        /* calculate sizes of the nvpair elements and the nvpair itself */
        name_sz = strlen(name) + 1;
+       if (name_sz >= 1ULL << (sizeof (nvp->nvp_name_sz) * 8 - 1))
+               return (EINVAL);
 
        nvp_sz = NVP_SIZE_CALC(name_sz, value_sz);
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to