[PATCH] UUID detection - LUKS partitions

Denys Vlasenko vda.linux at googlemail.com
Sun Oct 12 11:21:31 UTC 2008


On Friday 10 October 2008 04:14:21 pm Michal Toman wrote:
> Hello,
> 
> I discovered a bug in UUID detection of LUKS encrypted partitions.  The 
> function volume_id_get_buffer() expects the number of bytes but the 
> number of sectors is passed (util-linux/volume_id/luks.c). Only 2 bytes 
> were read instead of the whole LUKS header. Patch is attached.

Applied, thanks.

> The second discovered issue is the overoptimistic approach used in UUID 
> detection on fat partitions.  It fails on my 2 USB flash sticks (FAT32). 
> Both sticks seem to be ok for other utilities not based on busybox.
> The problem was found at util-linux/volume_id/fatc:291 
> (volume_id_get_buffer()) where the offset off+next_off can point out of 
> the partition. It is caused either by the misinterpretation of the 
> cluster data or cluster corruption. As a result, the xlseek() function 
> at /util-linux/volume_id/util.c:237 exits the program.

Fixed. end-of-cluster-chain detections was wrong.

> BTW it is not good approach to exit the program because of the wrong 
> lseek parameter. Due to lack of time, it is not possible to investigate 
> this thing in detail.  I just disabled UUID check on FAT partitions 
> (CONFIG_FEATURE_VOLUME_ID_FAT) as a hot fix. This works perfectly for my 
> purpose. Anyway, FAT32 UUID detection seems to be broken.

Fixed. Please try attached patch.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7.patch
Type: text/x-diff
Size: 12184 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20081012/4853f0e3/attachment.bin 


More information about the busybox mailing list