diff options
author | Steve Magnani <steve.magnani@digidescorp.com> | 2019-02-11 09:24:38 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2019-02-11 12:31:35 -0500 |
commit | 4f5edd82eb375f0e949192ac5a0b42858356e05d (patch) | |
tree | 3ea5e479fe38b1688f574a4db8fd002ee8801713 /fs/udf/super.c | |
parent | e8b4274735e416621cfb28c2802b4ad52da35d0f (diff) |
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>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 2cf435c87583..a6940d90bedd 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -1474,6 +1474,17 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, | |||
1474 | if (lvd->integritySeqExt.extLength) | 1474 | if (lvd->integritySeqExt.extLength) |
1475 | udf_load_logicalvolint(sb, leea_to_cpu(lvd->integritySeqExt)); | 1475 | udf_load_logicalvolint(sb, leea_to_cpu(lvd->integritySeqExt)); |
1476 | ret = 0; | 1476 | 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 | } | ||
1477 | out_bh: | 1488 | out_bh: |
1478 | brelse(bh); | 1489 | brelse(bh); |
1479 | return ret; | 1490 | return ret; |