Skip to contentSkip to conversation

udf: Disallow R/W mode for disk with Metadata partition

PATCH In review Pali Rohár 2 participants 2 messages Jan 12, 2020 – Jan 13, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udf: Disallow R/W mode for disk with Metadata partition

Currently we do not support writing to UDF disks with Metadata partition. There is already check that disks with declared minimal write revision to UDF 2.50 or higher are mounted only in R/O mode but this does not cover situation when minimal write revision is set incorrectly (e.g. to 2.01).

---
 fs/udf/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/udf/super.c +2 -1
index 8c28e93e9..3b7073c2f 100644
@@ -1063,7 +1063,8 @@ static int check_partition_desc(struct super_block *sb,
 		goto force_ro;
 
 	if (map->s_partition_type == UDF_VIRTUAL_MAP15 ||
-	    map->s_partition_type == UDF_VIRTUAL_MAP20)
+	    map->s_partition_type == UDF_VIRTUAL_MAP20 ||
+	    map->s_partition_type == UDF_METADATA_MAP25)
 		goto force_ro;
 
 	return 0;
Signature · 1 line
2.20.1
reviewer
#1 lore raw
Quoted 6 lines · Pali Rohár

Currently we do not support writing to UDF disks with Metadata partition. There is already check that disks with declared minimal write revision to UDF 2.50 or higher are mounted only in R/O mode but this does not cover situation when minimal write revision is set incorrectly (e.g. to 2.01).

Yeah, right. Better be cautious. I've added the patch to my tree.

Honza

Quoted 21 lines
---
 fs/udf/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/udf/super.c +2 -1
index 8c28e93e9..3b7073c2f 100644
@@ -1063,7 +1063,8 @@ static int check_partition_desc(struct super_block *sb,
 		goto force_ro;
 
 	if (map->s_partition_type == UDF_VIRTUAL_MAP15 ||
-	    map->s_partition_type == UDF_VIRTUAL_MAP20)
+	    map->s_partition_type == UDF_VIRTUAL_MAP20 ||
+	    map->s_partition_type == UDF_METADATA_MAP25)
 		goto force_ro;
 
 	return 0;
Signature · 1 line
2.20.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR