]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
udf: Allow volume descriptor sequence to be terminated by unrecorded block
authorJan Kara <jack@suse.cz>
Thu, 8 Feb 2018 17:10:54 +0000 (18:10 +0100)
committerJan Kara <jack@suse.cz>
Fri, 16 Feb 2018 10:15:09 +0000 (11:15 +0100)
According to ECMA-167 3/8.4.2 a volume descriptor sequence can be
terminated also by an unrecorded block within the extent of volume
descriptor sequence. Currently we errored out in such case making such
volumes unmountable. Handle that case by treating any invalid block as a
block terminating the sequence.

Reported-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/super.c

index f80b97173acda29a1c7a7b1a23c03425fab72bf4..456d737fc7ca046c4387ef824b0d39ef788a514d 100644 (file)
@@ -1627,12 +1627,8 @@ static noinline int udf_process_sequence(
        for (; (!done && block <= lastblock); block++) {
 
                bh = udf_read_tagged(sb, block, block, &ident);
-               if (!bh) {
-                       udf_err(sb,
-                               "Block %llu of volume descriptor sequence is corrupted or we could not read it\n",
-                               (unsigned long long)block);
-                       return -EAGAIN;
-               }
+               if (!bh)
+                       break;
 
                /* Process each descriptor (ISO 13346 3/8.3-8.4) */
                gd = (struct generic_desc *)bh->b_data;