[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] [PATCH 1/1] Fix use of vgname and vgid



On Wed, Apr 20, 2011 at 02:37:07PM +0200, Zdenek Kabelac wrote:
> As get_pv_from_vg_by_id() may call lvmcache_label_scan() keep the vgname
> and vgid copied localy on the stack as vginfo may dissapear and code was
> then accessing garbage in memory.
 
Currently, vginfo structs must not be held across calls to vg_read (or used as
parameters).

Have you audited the code to check there are no similar problems elsewhere?

I'm not too happy with the workaround in this patch, but it'll do for now,
as a proper fix would take quite a bit longer to develop.

> +		/*
> +		 * get_pv_from_vg_by_id() may lead to
> +		 * lvmcache_label_scan() so it can drop
> +		 * vginfo and all referenced data.
> +		 */

Document the restriction I mentioned above at the vg_read* entry point.

Alasdair


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]