Date: Fri, 3 Aug 2018 01:17:14 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337218 - vendor-sys/illumos/dist/common/nvpair Message-ID: <201808030117.w731HE1Q070867@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Aug 3 01:17:14 2018 New Revision: 337218 URL: https://svnweb.freebsd.org/changeset/base/337218 Log: 7261 nvlist code should enforce name length limit illumos/illumos-gate@48dd5e630c9b1773b7b10d08a3b90b6c9062d713 Reviewed by: Sebastien Roy <sebastien.roy@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Dan McDonald <danmcd@omniti.com> Author: Matthew Ahrens <mahrens@delphix.com> Modified: vendor-sys/illumos/dist/common/nvpair/nvpair.c Modified: vendor-sys/illumos/dist/common/nvpair/nvpair.c ============================================================================== --- vendor-sys/illumos/dist/common/nvpair/nvpair.c Fri Aug 3 01:09:12 2018 (r337217) +++ vendor-sys/illumos/dist/common/nvpair/nvpair.c Fri Aug 3 01:17:14 2018 (r337218) @@ -910,6 +910,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) * NBBY - 1)) + return (EINVAL); nvp_sz = NVP_SIZE_CALC(name_sz, value_sz);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808030117.w731HE1Q070867>