summaryrefslogtreecommitdiffstats
path: root/fs/udf/misc.c
diff options
context:
space:
mode:
authorSteve Magnani2017-10-12 15:48:40 +0200
committerJan Kara2017-10-17 11:56:45 +0200
commitb490bdd630cc43a5725e76c7c23f8a7e55551145 (patch)
tree9ee95e0af7d247b2a8b282b2b5ed1a783465e9da /fs/udf/misc.c
parentudf: Remove some outdate references from documentation (diff)
downloadkernel-qcow2-linux-b490bdd630cc43a5725e76c7c23f8a7e55551145.tar.gz
kernel-qcow2-linux-b490bdd630cc43a5725e76c7c23f8a7e55551145.tar.xz
kernel-qcow2-linux-b490bdd630cc43a5725e76c7c23f8a7e55551145.zip
udf: Fix 64-bit sign extension issues affecting blocks > 0x7FFFFFFF
Large (> 1 TiB) UDF filesystems appear subject to several problems when mounted on 64-bit systems: * readdir() can fail on a directory containing File Identifiers residing above 0x7FFFFFFF. This manifests as a 'ls' command failing with EIO. * FIBMAP on a file block located above 0x7FFFFFFF can return a negative value. The low 32 bits are correct, but applications that don't mask the high 32 bits of the result can perform incorrectly. Per suggestion by Jan Kara, introduce a udf_pblk_t type for representation of UDF block addresses. Ultimately, all driver functions that manipulate UDF block addresses should use this type; for now, deployment is limited to functions with actual or potential sign extension issues. Changes to udf_readdir() and udf_block_map() address the issues noted above; other changes address potential similar issues uncovered during audit of the driver code. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/misc.c')
-rw-r--r--fs/udf/misc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index 3949c4bec3a3..97f3258a7483 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -28,7 +28,7 @@
#include "udf_i.h"
#include "udf_sb.h"
-struct buffer_head *udf_tgetblk(struct super_block *sb, int block)
+struct buffer_head *udf_tgetblk(struct super_block *sb, udf_pblk_t block)
{
if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV))
return sb_getblk(sb, udf_fixed_to_variable(block));
@@ -36,7 +36,7 @@ struct buffer_head *udf_tgetblk(struct super_block *sb, int block)
return sb_getblk(sb, block);
}
-struct buffer_head *udf_tread(struct super_block *sb, int block)
+struct buffer_head *udf_tread(struct super_block *sb, udf_pblk_t block)
{
if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV))
return sb_bread(sb, udf_fixed_to_variable(block));