-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[metadata] uninitialized members in struct pv_list #10
Comments
Dne 14. 12. 18 v 10:51 Ming-Hung Tsai napsal(a):
Scenario: Given an existed LV |lvol0|, I want to create another LV on the PVs
used by |lvol0|
I use |build_parallel_areas_from_lv()| to obtain the |pv_list| of each
segments. However, the returned |pv_list| is not properly initialized, which
causes segfault in subsequent operations.
Here's the patch:
|diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index
2c569d8f9..27c40d710 100644 --- a/lib/metadata/lv_manip.c +++
b/lib/metadata/lv_manip.c @@ -5962,7 +5962,7 @@ static int _add_pvs(struct
cmd_context *cmd, struct pv_segment *peg, if (find_pv_in_pv_list(&spvs->pvs,
peg->pv)) return 1; - if (!(pvl = dm_pool_alloc(cmd->mem, sizeof(*pvl)))) { +
if (!(pvl = dm_pool_zalloc(cmd->mem, sizeof(*pvl)))) { log_error("pv_list
allocation failed"); return 0; } |
Hi
Thanks for noticing, pushed upstream.
Zdenek
|
Thanks. Could you help backport to the 2018-06-01-stable branch, please? |
Done. Thank you! |
Scenario: Given an existed LV `lvol0`, I want to create another LV on the PVs used by `lvol0`. I use `build_parallel_areas_from_lv()` to obtain the `pv_list` of each segments. However, the returned `pv_list` is not properly initialized, which causes segfault in subsequent operations. (cherry picked from commit 859feb8) (cherry picked from commit 219ba4f) Conflicts: WHATS_NEW
@mingnus could you tell me how to reproduce the segmentfault issue, I run |
@wangwang3210 |
Scenario: Given an existed LV `lvol0`, I want to create another LV on the PVs used by `lvol0`. I use `build_parallel_areas_from_lv()` to obtain the `pv_list` of each segments. However, the returned `pv_list` is not properly initialized, which causes segfault in subsequent operations.
Scenario: Given an existed LV
lvol0
, I want to create another LV on the PVs used bylvol0
I use
build_parallel_areas_from_lv()
to obtain thepv_list
of each segments. However, the returnedpv_list
is not properly initialized, which causes segfault in subsequent operations.Here's the patch:
The text was updated successfully, but these errors were encountered: