Actions
Bug #6120
closedlibzfs leaks a config nvlist for spares and l2arc
Start date:
2015-08-12
Due date:
% Done:
80%
Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
Description
The add_config
function in libzfs fails to free the passed in config nvlist in a couple of cases. If the following condition is true, the config will be leaked:
if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE, &state) == 0 && (state == POOL_STATE_SPARE || state == POOL_STATE_L2CACHE) && nvlist_lookup_uint64(config, ZPOOL_CONFIG_GUID, &vdev_guid) == 0) {
All other paths though this function free the config - regardless of whether the function succeeded. Since the caller and the rest of this function assumes that add_config
frees the passed in config, it makes sense to fix the 3 cases places in this if statement that leak it.
Related issues
Updated by Yuri Pankov over 5 years ago
- Is duplicate of Bug #7730: libzfs`add_config() leaks config nvl when reading spare/l2cache devices added
Actions