Files
linux/fs
Chao Yu 830390b363 FROMGIT: f2fs: fix potential .flags overflow on 32bit architecture
f2fs_inode_info.flags is unsigned long variable, it has 32 bits
in 32bit architecture, since we introduced FI_MMAP_FILE flag
when we support data compression, we may access memory cross
the border of .flags field, corrupting .i_sem field, result in
below deadlock.

To fix this issue, let's expand .flags as an array to grab enough
space to store new flags.

Call Trace:
 __schedule+0x8d0/0x13fc
 ? mark_held_locks+0xac/0x100
 schedule+0xcc/0x260
 rwsem_down_write_slowpath+0x3ab/0x65d
 down_write+0xc7/0xe0
 f2fs_drop_nlink+0x3d/0x600 [f2fs]
 f2fs_delete_inline_entry+0x300/0x440 [f2fs]
 f2fs_delete_entry+0x3a1/0x7f0 [f2fs]
 f2fs_unlink+0x500/0x790 [f2fs]
 vfs_unlink+0x211/0x490
 do_unlinkat+0x483/0x520
 sys_unlink+0x4a/0x70
 do_fast_syscall_32+0x12b/0x683
 entry_SYSENTER_32+0xaa/0x102

Change-Id: I2777d32fd64e55514549fe82be397fdd671beaf6
Fixes: 4c8ff7095b ("f2fs: support data compression")
Tested-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 7de5ad45b809b5043fb12c3e280ceffe9a6a13d4
 git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs dev)
2020-03-26 16:41:53 +08:00
..
2019-08-06 19:06:51 +02:00
2019-12-13 08:52:23 +01:00
2020-03-05 17:40:55 +01:00
2019-12-13 08:52:36 +01:00
2018-08-17 16:20:28 -07:00
2019-05-22 08:00:39 +02:00
2019-12-13 10:01:10 +01:00
2019-12-13 08:51:59 +01:00
2020-02-24 09:13:25 +01:00
2020-01-12 12:29:19 +01:00
2018-08-17 16:20:27 -07:00
2019-12-18 09:03:30 +01:00
2020-02-13 15:14:20 -08:00
2020-01-09 16:14:43 +01:00
2020-03-05 16:42:12 +01:00
2019-08-04 09:37:11 +02:00
2019-05-31 08:14:29 -07:00
2020-03-05 17:40:55 +01:00
2020-03-18 08:19:47 +01:00
2019-12-01 09:53:43 +01:00
2020-01-04 19:29:03 +01:00