[PATCH] UUID detection - LUKS partitions

Michal Toman moti at pilsfree.net
Fri Oct 10 14:14:21 UTC 2008


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.

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.

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.

---
Michal Toman

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: busybox-uuid-luks.patch
Url: http://lists.busybox.net/pipermail/busybox/attachments/20081010/5d419596/attachment.diff 


More information about the busybox mailing list