linux-stable/fs/udf
lianzhi chang 8e59209d53 udf: fix the problem that the disc content is not displayed
[ Upstream commit 5cdc4a6950 ]

When the capacity of the disc is too large (assuming the 4.7G
specification), the disc (UDF file system) will be burned
multiple times in the windows (Multisession Usage). When the
remaining capacity of the CD is less than 300M (estimated
value, for reference only), open the CD in the Linux system,
the content of the CD is displayed as blank (the kernel will
say "No VRS found"). Windows can display the contents of the
CD normally.
Through analysis, in the "fs/udf/super.c": udf_check_vsd
function, the actual value of VSD_MAX_SECTOR_OFFSET may
be much larger than 0x800000. According to the current code
logic, it is found that the type of sbi->s_session is "__s32",
 when the remaining capacity of the disc is less than 300M
(take a set of test values: sector=3154903040,
sbi->s_session=1540464, sb->s_blocksize_bits=11 ), the
calculation result of "sbi->s_session << sb->s_blocksize_bits"
 will overflow. Therefore, it is necessary to convert the
type of s_session to "loff_t" (when udf_check_vsd starts,
assign a value to _sector, which is also converted in this
way), so that the result will not overflow, and then the
content of the disc can be displayed normally.

Link: https://lore.kernel.org/r/20210114075741.30448-1-changlianzhi@uniontech.com
Signed-off-by: lianzhi chang <changlianzhi@uniontech.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-02-07 15:35:49 +01:00
..
balloc.c udf: prevent allocation beyond UDF partition 2019-07-31 18:41:37 +02:00
dir.c
directory.c
ecma_167.h udf: Verify domain identifier fields 2019-09-04 18:19:25 +02:00
file.c udf: augment UDF permissions on new inodes 2019-08-27 15:38:46 +02:00
ialloc.c udf: augment UDF permissions on new inodes 2019-08-27 15:38:46 +02:00
inode.c udf: Avoid accessing uninitialized data on failed inode read 2020-10-29 09:58:05 +01:00
Kconfig
lowlevel.c
Makefile
misc.c
namei.c
osta_udf.h
partition.c
super.c udf: fix the problem that the disc content is not displayed 2021-02-07 15:35:49 +01:00
symlink.c
truncate.c
udf_i.h udf: augment UDF permissions on new inodes 2019-08-27 15:38:46 +02:00
udf_sb.h
udfdecl.h udf: augment UDF permissions on new inodes 2019-08-27 15:38:46 +02:00
udfend.h
udftime.c
unicode.c