libblkid: udf superblock does not read correctly when blocksize < 2048
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Util-Linux-ng |
Fix Released
|
Unknown
|
|||
util-linux (Ubuntu) |
Fix Released
|
Medium
|
Jim Trigg | ||
Precise |
Fix Released
|
Undecided
|
Unassigned | ||
Quantal |
Won't Fix
|
Undecided
|
Unassigned | ||
Raring |
Won't Fix
|
Low
|
Unassigned | ||
Saucy |
Fix Released
|
Medium
|
Jim Trigg |
Bug Description
[Impact]
* udf filesystems with blocksize < 2048 will not automount at startup.
* udf filesystems with blocksize < 2048 will not show or be mounted by volume label (vid).
[Test Case]
Install udftools and create udf file system with volume id and blocksize < 2048:
"sudo mkudffs -b 512 --vid=space /dev/sdb1"
Run blkid on device: "sudo blkid /dev/sdb1"
Without patch, output will be 'TYPE="udf"'. With patch, output will be 'TYPE="udf" LABEL="space"'.
Add /dev/sdb1 to /etc/fstab. Without patch, file system will fail to mount at boot; with patch, file system will mount at boot.
Add LABEL=space to /etc/fstab. Without patch, file system will fail to mount; with patch, file system will mount.
[Regression Potential]
* This issue has been identified upstream and a patch is available (git commit 5a45eb2d2c70dc7
Related branches
- Dimitri John Ledkov: Approve
- Ubuntu branches: Pending requested
-
Diff: 102 lines (+39/-17)3 files modifiedAUTHORS (+1/-0)
debian/changelog (+6/-0)
libblkid/src/superblocks/udf.c (+32/-17)
- Marc Deslauriers: Approve
-
Diff: 102 lines (+39/-17)3 files modifiedAUTHORS (+1/-0)
debian/changelog (+6/-0)
libblkid/src/superblocks/udf.c (+32/-17)
Changed in util-linux (Ubuntu): | |
assignee: | nobody → Jim Trigg (jtrigg) |
status: | New → Fix Committed |
tags: | added: precise quantal raring |
Changed in util-linux (Ubuntu): | |
status: | Fix Committed → Confirmed |
importance: | Undecided → Medium |
description: | updated |
Changed in util-linux (Ubuntu Raring): | |
importance: | Undecided → Low |
status: | Confirmed → In Progress |
Changed in util-linux-ng: | |
status: | Unknown → New |
Changed in util-linux-ng: | |
status: | New → Confirmed |
Changed in util-linux-ng: | |
status: | Confirmed → Fix Released |
diff --git a/AUTHORS b/AUTHORS src/superblocks /udf.c b/libblkid/ src/superblocks /udf.c src/superblocks /udf.c src/superblocks /udf.c blkid_probe pr, structure_ descriptor *vsd;
index f29f9a3..54fe7ce 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -385,5 +385,6 @@ CONTRIBUTORS:
Yoshihiro Takahashi <email address hidden>
Yuri Chornoivan <email address hidden>
Yu Zhiguo <email address hidden>
+ Zachary Catlin <email address hidden>
Zdenek Behan <email address hidden>
Zhi Li <email address hidden>
diff --git a/libblkid/
index 2cb471d..c9fb022 100644
--- a/libblkid/
+++ b/libblkid/
@@ -64,17 +64,25 @@ static int probe_udf(
struct volume_descriptor *vd;
struct volume_
unsigned int bs;
+ unsigned int pbs[2];
unsigned int b;
unsigned int type;
unsigned int count;
unsigned int loc;
+ unsigned int i;
- /* search Volume Sequence Descriptor (VSD) to get the logical get_sectorsize( pr); structure_ descriptor *)
blkid_ probe_get_ buffer( pr,
sizeof( *vsd));
return 1; blkid_probe pr, structure_ descriptor *)
blkid_ probe_get_ buffer( pr,
sizeof( *vsd));
return -1; blkid_probe pr,
- * block size of the volume */
- for (bs = 0x800; bs < 0x8000; bs += 0x800) {
+ /* The block size of a UDF filesystem is that of the underlying
+ * storage; we check later on for the special case of image files,
+ * which may have the 2048-byte block size of optical media. */
+ pbs[0] = blkid_probe_
+ pbs[1] = 0x800;
+
+ /* check for a Volume Structure Descriptor (VSD); each is
+ * 2048 bytes long */
+ for (b = 0; b < 0x8000; b += 0x800) {
vsd = (struct volume_
- UDF_VSD_OFFSET + bs,
+ UDF_VSD_OFFSET + b,
if (!vsd)
@@ -88,7 +96,7 @@ static int probe_udf(
for (b = 0; b < 64; b++) {
vsd = (struct volume_
- UDF_VSD_OFFSET + ((blkid_loff_t) b * bs),
+ UDF_VSD_OFFSET + ((blkid_loff_t) b * 0x800),
if (!vsd)
@@ -102,17 +110,24 @@ static int probe_udf(
return -1;
anchor: get_buffer( pr, 256 * bs, sizeof(*vd)); cpu(vd- >tag.id) ; get_buffer( pr, 256 * pbs[i], sizeof(*vd)); cpu(vd- >tag.id) ;
- /* read Anchor Volume Descriptor (AVDP) */
- vd = (struct volume_descriptor *)
- blkid_probe_
- if (!vd)
- return -1;
-
- type = le16_to_
- if (type != 2) /* TAG_ID_AVDP */
- return 0;
+ /* read Anchor Volume Descriptor (AVDP), checking block size */
+ for (i = 0; i < 2; i++) {
+ vd = (struct volume_descriptor *)
+ blkid_probe_
+ if (!vd)
+ return -1;
+
+ type = le16_to_
+ if (type == 2) /* TAG_ID_AVDP */
+ goto real_blksz;
+ }
+ return 0;
+
+real_blksz:
+ /* Use t...