Skip to content

Commit 4f5edd8

Browse files
Steve Magnanijankara
authored andcommitted
udf: disallow RW mount without valid integrity descriptor
Refuse to mount a volume read-write without a coherent Logical Volume Integrity Descriptor, because we can't generate truly unique IDs without one. This fixes a bug where all inodes created on a UDF filesystem following mount without a coherent LVID are assigned unique ID 0 which can then confuse other UDF implementations. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent e8b4274 commit 4f5edd8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎fs/udf/super.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,17 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
14741474
if (lvd->integritySeqExt.extLength)
14751475
udf_load_logicalvolint(sb, leea_to_cpu(lvd->integritySeqExt));
14761476
ret = 0;
1477+
1478+
if (!sbi->s_lvid_bh) {
1479+
/* We can't generate unique IDs without a valid LVID */
1480+
if (sb_rdonly(sb)) {
1481+
UDF_SET_FLAG(sb, UDF_FLAG_RW_INCOMPAT);
1482+
} else {
1483+
udf_warn(sb, "Damaged or missing LVID, forcing "
1484+
"readonly mount\n");
1485+
ret = -EACCES;
1486+
}
1487+
}
14771488
out_bh:
14781489
brelse(bh);
14791490
return ret;

0 commit comments

Comments
 (0)