diff options
author | Matthew Ahrens <[email protected]> | 2016-08-04 16:16:29 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-08-30 11:58:00 -0700 |
commit | 24ded86e8dd528b056d73630ff33e526f9540dbc (patch) | |
tree | 19bf7d80707b9085c31cab2e1523b258b1c979a8 | |
parent | 006309e8d75b22efc7418095e408b3b3774ef8ea (diff) |
OpenZFS 7261 - nvlist code should enforce name length limit
Authored by: Matthew Ahrens <[email protected]>
Reviewed by: Sebastien Roy <[email protected]>
Reviewed by: George Wilson <[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/7261
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/48dd5e6
Closes #6579
-rw-r--r-- | module/nvpair/nvpair.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/module/nvpair/nvpair.c b/module/nvpair/nvpair.c index 8e654053c..dffb226a2 100644 --- a/module/nvpair/nvpair.c +++ b/module/nvpair/nvpair.c @@ -916,6 +916,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); |