1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00
lvm2/lib
Heming Zhao db22a389cf toolcontext: fix double free (core dumped) issue
How to trigger:

```
~ # export LVM_SYSTEM_DIR=_
~ # pvscan
  No matching physical volumes found
double free or corruption (!prev)
Aborted (core dumped)
```

when LVM_SYSTEM_DIR is empty, _load_config_file() won't be called.

when LVM_SYSTEM_DIR is not empty, cfl->cft links into cmd->config_files
by _load_config_file()@lib/commands/toolcontext.c

core dumped code: _destroy_config()@lib/commands/toolcontext.c

```
    /* CONFIG_FILE/CONFIG_MERGED_FILES */
    if ((cft = remove_config_tree_by_source(cmd, CONFIG_MERGED_FILES)))
        config_destroy(cft);
    else if ((cft = remove_config_tree_by_source(cmd, CONFIG_FILE)))
        config_destroy(cft); <=== first free the cft

    dm_list_iterate_items(cfl, &cmd->config_files)
        config_destroy(cfl->cft); <=== double free the cft
```

Fixes: c43f2f8ae0

Signed-off-by: Heming Zhao <heming.zhao@suse.com>
2021-07-12 14:10:21 -05:00
..
activate vdo: fix preload of kvdo 2021-05-26 16:12:20 +02:00
cache skip indexing devices used by LVs in more commands 2021-07-09 13:59:31 -05:00
cache_segtype cachevol: move flag setting after taking archive 2019-10-17 13:03:50 +02:00
commands toolcontext: fix double free (core dumped) issue 2021-07-12 14:10:21 -05:00
config scan: move metadata vgname check 2021-07-06 10:10:23 -05:00
datastruct cleanup: eliminate unused assign 2021-03-11 00:18:01 +01:00
device skip indexing devices used by LVs in more commands 2021-07-09 13:59:31 -05:00
display lib: locking: Add new type "idm" 2021-05-20 16:01:05 -05:00
error device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
filters devices file: recommend removing filter 2021-05-05 13:59:42 -05:00
format_text scan: move metadata vgname check 2021-07-06 10:10:23 -05:00
freeseg device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
integrity cleanup: no backtraces needed after log_error 2021-03-10 01:11:52 +01:00
label scan: retry reading metadata on error 2021-07-06 10:10:23 -05:00
locking backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
log debug: keep microseconds aligned 2021-03-15 11:13:24 +01:00
lvmpolld device usage based on devices file 2021-02-23 16:43:32 -06:00
metadata pvscan: skip indexing devices used by LVs 2021-07-06 10:18:07 -05:00
mirror lv_info: missing check for info.exists 2021-03-14 16:34:38 +01:00
misc lib: remove unused macros 2021-04-06 22:02:31 +02:00
mm cov: initialize value 2021-03-11 00:18:01 +01:00
notify build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
properties build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
raid cleanup: reduce code dupliction 2021-03-19 23:21:18 +01:00
report Add metadata-based autoactivation property for VG and LV 2021-04-07 15:32:49 -05:00
snapshot typo: fixes 2021-02-08 23:53:41 +01:00
striped device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
thin targets: use target_present_version 2021-02-08 23:43:38 +01:00
unknown device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
uuid build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
vdo vdo: just one probe is enough 2021-02-17 11:21:35 +01:00
writecache typo: fixes 2021-02-08 23:53:41 +01:00
zero device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
Makefile.in make: cflow target works again 2021-03-20 00:05:01 +01:00