WSL2-Linux-Kernel/fs/isofs
Eric Sandeen 97ee8505c6 isofs: reject hardware sector size > 2048 bytes
[ Upstream commit 09a4e0be58 ]

The largest block size supported by isofs is ISOFS_BLOCK_SIZE (2048), but
isofs_fill_super calls sb_min_blocksize and sets the blocksize to the
device's logical block size if it's larger than what we ended up with after
option parsing.

If for some reason we try to mount a hard 4k device as an isofs filesystem,
we'll set opt.blocksize to 4096, and when we try to read the superblock
we found via:

        block = iso_blknum << (ISOFS_BLOCK_BITS - s->s_blocksize_bits)

with s_blocksize_bits greater than ISOFS_BLOCK_BITS, we'll have a negative
shift and the bread will fail somewhat cryptically:

  isofs_fill_super: bread failed, dev=sda, iso_blknum=17, block=-2147483648

It seems best to just catch and clearly reject mounts of such a device.

Reported-by: Bryan Gurney <bgurney@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-03 17:00:57 -07:00
..
Kconfig fs/Kconfig: move iso9660, udf out 2009-01-22 13:15:55 +03:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compress.c block,fs: untangle fs.h and blk_types.h 2016-11-01 09:43:26 -06:00
dir.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
export.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
inode.c isofs: reject hardware sector size > 2048 bytes 2018-10-03 17:00:57 -07:00
isofs.h isofs: fix timestamps beyond 2027 2017-11-30 08:40:45 +00:00
joliet.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
namei.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rock.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rock.h isofs: fix timestamps beyond 2027 2017-11-30 08:40:45 +00:00
util.c isofs: fix timestamps beyond 2027 2017-11-30 08:40:45 +00:00
zisofs.h [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00