linux/fs/udf
Vladislav Efanov 1e0d4adf17 udf: Check consistency of Space Bitmap Descriptor
Bits, which are related to Bitmap Descriptor logical blocks,
are not reset when buffer headers are allocated for them. As the
result, these logical blocks can be treated as free and
be used for other blocks.This can cause usage of one buffer header
for several types of data. UDF issues WARNING in this situation:

WARNING: CPU: 0 PID: 2703 at fs/udf/inode.c:2014
  __udf_add_aext+0x685/0x7d0 fs/udf/inode.c:2014

RIP: 0010:__udf_add_aext+0x685/0x7d0 fs/udf/inode.c:2014
Call Trace:
 udf_setup_indirect_aext+0x573/0x880 fs/udf/inode.c:1980
 udf_add_aext+0x208/0x2e0 fs/udf/inode.c:2067
 udf_insert_aext fs/udf/inode.c:2233 [inline]
 udf_update_extents fs/udf/inode.c:1181 [inline]
 inode_getblk+0x1981/0x3b70 fs/udf/inode.c:885

Found by Linux Verification Center (linuxtesting.org) with syzkaller.

[JK: Somewhat cleaned up the boundary checks]

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Vladislav Efanov <VEfanov@ispras.ru>
Signed-off-by: Jan Kara <jack@suse.cz>
2023-02-07 11:49:43 +01:00
..
balloc.c udf: Check consistency of Space Bitmap Descriptor 2023-02-07 11:49:43 +01:00
dir.c udf: Convert udf_readdir() to new directory iteration 2023-01-09 10:39:51 +01:00
directory.c udf: Drop VARCONV support 2023-01-26 16:46:32 +01:00
ecma_167.h udf: Get rid of 0-length arrays in struct fileIdentDesc 2021-08-11 16:54:44 +02:00
file.c udf: Move udf_adinicb_readpage() to inode.c 2023-01-26 16:46:36 +01:00
ialloc.c udf: Fix file counting in LVID 2023-01-26 16:46:37 +01:00
inode.c udf: Convert udf_expand_file_adinicb() to avoid kmap_atomic() 2023-01-26 16:46:37 +01:00
Kconfig docs: filesystems: fix renamed references 2020-04-20 15:45:22 -06:00
lowlevel.c udf: Unify types in anchor block detection 2023-01-26 16:46:32 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
misc.c udf: Drop VARCONV support 2023-01-26 16:46:32 +01:00
namei.c udf: Fix file counting in LVID 2023-01-26 16:46:37 +01:00
osta_udf.h udf: Get rid of 0-length arrays 2021-08-11 16:54:44 +02:00
partition.c udf: Use udf_bread() in udf_get_pblock_virt15() 2023-01-26 16:46:33 +01:00
super.c udf: Limit file size to 4TB 2023-01-26 16:46:37 +01:00
symlink.c udf: Convert udf_symlink_filler() to use udf_bread() 2023-01-26 16:46:33 +01:00
truncate.c udf: Drop VARCONV support 2023-01-26 16:46:32 +01:00
udf_i.h udf: Preserve link count of system files 2023-01-09 10:39:53 +01:00
udf_sb.h udf: Drop VARCONV support 2023-01-26 16:46:32 +01:00
udfdecl.h udf: Move udf_adinicb_readpage() to inode.c 2023-01-26 16:46:36 +01:00
udfend.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
udftime.c udf: convert inode stamps to timespec64 2018-06-27 13:58:00 +02:00
unicode.c udf: Fix iocharset=utf8 mount option 2021-08-12 16:07:09 +02:00