All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix segfault when using vgsplit in stacked environment
@ 2009-02-09  7:53 Peter Rajnoha
  2009-02-09 12:24 ` Milan Broz
  2009-02-10 18:14 ` Alasdair G Kergon
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Rajnoha @ 2009-02-09  7:53 UTC (permalink / raw)
  To: lvm-devel

Hi,

this is a small patch for segmentation fault in vgsplit while using 
stacked VGs (rh bz 481793). Segfault is caused by null dereference in 
'pv_uses_vg' function that is called to check if a PV uses VG somewhere 
in its construction. In stacked environment, when the LV/VG from lower 
layer is disabled, the PV constructed above does not exist as well and 
so the device value in PV's structure is set to NULL. We should check 
for this NULL value in 'pv_uses_vg' and return immediately if the 
situation occurs.

Peter


diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 2bc1db7..4ffd7bb 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1105,6 +1105,9 @@ int pv_uses_vg(struct physical_volume *pv,
  	if (!activation())
  		return 0;

+	if (!pv->dev || !pv->dev->dev)
+		return 1;
+
  	if (!dm_is_dm_major(MAJOR(pv->dev->dev)))
  		return 0;



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-02-16 22:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-09  7:53 [PATCH] Fix segfault when using vgsplit in stacked environment Peter Rajnoha
2009-02-09 12:24 ` Milan Broz
2009-02-10 18:14 ` Alasdair G Kergon
2009-02-12  9:03   ` Peter Rajnoha
2009-02-16 22:10   ` Petr Rockai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.