No description
  • C 98.2%
  • Assembly 1%
  • Makefile 0.3%
  • Shell 0.2%
  • Python 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Namjae Jeon 5d39deced1 exfat: fix shift-out-of-bounds in exfat_fill_super()
syzbot reported a warning which could cause shift-out-of-bounds issue.

Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x183/0x22e lib/dump_stack.c:120
 ubsan_epilogue lib/ubsan.c:148 [inline]
 __ubsan_handle_shift_out_of_bounds+0x432/0x4d0 lib/ubsan.c:395
 exfat_read_boot_sector fs/exfat/super.c:471 [inline]
 __exfat_fill_super fs/exfat/super.c:556 [inline]
 exfat_fill_super+0x2acb/0x2d00 fs/exfat/super.c:624
 get_tree_bdev+0x406/0x630 fs/super.c:1291
 vfs_get_tree+0x86/0x270 fs/super.c:1496
 do_new_mount fs/namespace.c:2881 [inline]
 path_mount+0x1937/0x2c50 fs/namespace.c:3211
 do_mount fs/namespace.c:3224 [inline]
 __do_sys_mount fs/namespace.c:3432 [inline]
 __se_sys_mount+0x2f9/0x3b0 fs/namespace.c:3409
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

exfat specification describe sect_per_clus_bits field of boot sector
could be at most 25 - sect_size_bits and at least 0. And sect_size_bits
can also affect this calculation, It also needs validation.
This patch add validation for sect_per_clus_bits and sect_size_bits
field of boot sector.

Fixes: 719c1e182916 ("exfat: add super block operations")
Cc: stable@vger.kernel.org # v5.9+
Reported-by: syzbot+da4fe66aaadd3c2e2d1c@syzkaller.appspotmail.com
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-02-01 10:35:05 +09:00
.travis.yml exfat: enable generic/452 test 2020-06-17 22:08:38 +09:00
.travis_cmd_wrapper.pl
.travis_get_mainline_kernel
balloc.c exfat: improve performance of exfat_free_cluster when using dirsync mount option 2021-02-01 10:33:25 +09:00
cache.c exfat: fix use of uninitialized spinlock on error path 2020-10-12 22:56:52 +09:00
dir.c exfat: remove 'rwoffset' in exfat_inode_info 2020-10-12 21:38:48 +09:00
exfat_fs.h exfat: improve performance of exfat_free_cluster when using dirsync mount option 2021-02-01 10:33:25 +09:00
exfat_raw.h exfat: fix shift-out-of-bounds in exfat_fill_super() 2021-02-01 10:35:05 +09:00
fatent.c exfat: improve performance of exfat_free_cluster when using dirsync mount option 2021-02-01 10:33:25 +09:00
file.c exfat: fix build error with i_blocksize 2020-12-08 12:25:44 +09:00
inode.c exfat: fix use of uninitialized spinlock on error path 2020-10-12 22:56:52 +09:00
Kconfig
Makefile exfat: linux 4.16 kernel build support 2020-02-04 09:18:10 +09:00
misc.c exfat: fix build error on 32bit & 4.19 lower kernel version 2020-07-03 12:40:25 +09:00
namei.c exfat: remove useless check in exfat_move_file() 2020-10-12 23:02:49 +09:00
nls.c exfat: Avoid allocating upcase table using kcalloc() 2020-12-08 12:51:04 +09:00
README.md exfat: fix typo 2020-02-10 21:35:58 +09:00
super.c exfat: fix shift-out-of-bounds in exfat_fill_super() 2021-02-01 10:35:05 +09:00

exFAT filesystem

This is the exfat filesystem for support from the linux 4.1 kernel to the latest kernel.

Installing as a stand-alone module

Install prerequisite package for Fedora, RHEL:

	yum install kernel-devel-$(uname -r)

Build step:

	make
	sudo make install

To load the driver manually, run this as root:

	modprobe exfat

Installing as a part of the kernel

  1. Let's take [linux] as the path to your kernel source dir.
	cd [linux]
	cp -ar exfat [linux]/fs/
  1. edit [linux]/fs/Kconfig
	source "fs/fat/Kconfig"
	+source "fs/exfat/Kconfig"
	source "fs/ntfs/Kconfig"
  1. edit [linux]/fs/Makefile
	obj-$(CONFIG_FAT_FS)          += fat/
	+obj-$(CONFIG_EXFAT_FS)       += exfat/
	obj-$(CONFIG_BFS_FS)          += bfs/
  1. make menuconfig and set exfat
	File systems  --->
		DOS/FAT/NT Filesystems  --->
			<M> exFAT filesystem support
			(utf8) Default iocharset for exFAT

build your kernel