• Dave Jones's avatar
    [PATCH] LVM fixes. · 24f27632
    Dave Jones authored
    Numerous LVM fixes & cleanups.
    Gets things compiling again, and allegedly works according to feedback.
    Mostly from Anders in absence of any maintainence by LVM people.
    
    There are two critical problems with lvm in 2.5.2-pre11 (and earlier).
    * ioctls on the chardev allocates a >4k lv_t on stack. if the ioctl is
    LV_CREATE, LV_EXTEND, LV_REDUCE or LV_RENAME data is copied into this
    and the task_struct will most certainly be corrupted.
    * sizeof(lv_t) differs between user and kernelspace. The userspace version
    of the lv_t structure is much smaller than the kernelspace version. This
    leads to corruption of memory in the userspace application when an lv_t is
    copied from kernelspace to userspace, as in "vgdisplay -v"
    
    The following patch addresses these two issues. It puts the user-space
    version of the lv_t into a substructure of the kernelspace version. When
    communicating to userspace just the userlv_t part is used. This avoids the
    allocation of the lv_t on the stack by allocation just a userlv_t instead.
    24f27632
lvm-snap.c 18.4 KB