diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2019-09-14 11:46:18 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2019-09-14 11:46:18 -0400 |
commit | 01fffb42bbfa1ee523bd9388b16ea799d5d35335 (patch) | |
tree | 015ba4fa0be0d8e1ab015f64a844cbb9765d15d3 | |
parent | 5e0cf85db40274d616601fe9c9a691246d6de4c9 (diff) | |
download | longterm-queue-4.18-01fffb42bbfa1ee523bd9388b16ea799d5d35335.tar.gz |
f2fs: drop commit n/a for 4.18.x
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/f2fs-fix-to-do-checksum-even-if-inode-page-is-uptoda.patch | 92 | ||||
-rw-r--r-- | queue/series | 1 |
2 files changed, 0 insertions, 93 deletions
diff --git a/queue/f2fs-fix-to-do-checksum-even-if-inode-page-is-uptoda.patch b/queue/f2fs-fix-to-do-checksum-even-if-inode-page-is-uptoda.patch deleted file mode 100644 index c24417f..0000000 --- a/queue/f2fs-fix-to-do-checksum-even-if-inode-page-is-uptoda.patch +++ /dev/null @@ -1,92 +0,0 @@ -From b42b179bda9ff11075a6fc2bac4d9e400513679a Mon Sep 17 00:00:00 2001 -From: Chao Yu <yuchao0@huawei.com> -Date: Mon, 15 Apr 2019 15:28:35 +0800 -Subject: [PATCH] f2fs: fix to do checksum even if inode page is uptodate - -commit b42b179bda9ff11075a6fc2bac4d9e400513679a upstream. - -As Jungyeon reported in bugzilla: - -https://bugzilla.kernel.org/show_bug.cgi?id=203221 - -- Overview -When mounting the attached crafted image and running program, this error is reported. - -The image is intentionally fuzzed from a normal f2fs image for testing and I enabled option CONFIG_F2FS_CHECK_FS on. - -- Reproduces -cc poc_07.c -mkdir test -mount -t f2fs tmp.img test -cp a.out test -cd test -sudo ./a.out - -- Messages - kernel BUG at fs/f2fs/node.c:1279! - RIP: 0010:read_node_page+0xcf/0xf0 - Call Trace: - __get_node_page+0x6b/0x2f0 - f2fs_iget+0x8f/0xdf0 - f2fs_lookup+0x136/0x320 - __lookup_slow+0x92/0x140 - lookup_slow+0x30/0x50 - walk_component+0x1c1/0x350 - path_lookupat+0x62/0x200 - filename_lookup+0xb3/0x1a0 - do_fchmodat+0x3e/0xa0 - __x64_sys_chmod+0x12/0x20 - do_syscall_64+0x43/0xf0 - entry_SYSCALL_64_after_hwframe+0x44/0xa9 - -On below paths, we can have opportunity to readahead inode page -- gc_node_segment -> f2fs_ra_node_page -- gc_data_segment -> f2fs_ra_node_page -- f2fs_fill_dentries -> f2fs_ra_node_page - -Unlike synchronized read, on readahead path, we can set page uptodate -before verifying page's checksum, then read_node_page() will trigger -kernel panic once it encounters a uptodated page w/ incorrect checksum. - -So considering readahead scenario, we have to do checksum each time -when loading inode page even if it is uptodated. - -Signed-off-by: Chao Yu <yuchao0@huawei.com> -Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> - -diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c -index 4edd6f2bb491..b53952a15ffa 100644 ---- a/fs/f2fs/inode.c -+++ b/fs/f2fs/inode.c -@@ -177,8 +177,8 @@ bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct page *page) - - if (provided != calculated) - f2fs_msg(sbi->sb, KERN_WARNING, -- "checksum invalid, ino = %x, %x vs. %x", -- ino_of_node(page), provided, calculated); -+ "checksum invalid, nid = %lu, ino_of_node = %x, %x vs. %x", -+ page->index, ino_of_node(page), provided, calculated); - - return provided == calculated; - } -diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c -index d45ecef75116..5452a6e340da 100644 ---- a/fs/f2fs/node.c -+++ b/fs/f2fs/node.c -@@ -1281,9 +1281,10 @@ static int read_node_page(struct page *page, int op_flags) - int err; - - if (PageUptodate(page)) { --#ifdef CONFIG_F2FS_CHECK_FS -- f2fs_bug_on(sbi, !f2fs_inode_chksum_verify(sbi, page)); --#endif -+ if (!f2fs_inode_chksum_verify(sbi, page)) { -+ ClearPageUptodate(page); -+ return -EBADMSG; -+ } - return LOCKED_PAGE; - } - --- -2.7.4 - diff --git a/queue/series b/queue/series index 6ef93fc..0126ef2 100644 --- a/queue/series +++ b/queue/series @@ -38,7 +38,6 @@ f2fs-fix-to-clear-dirty-inode-in-error-path-of-f2fs_.patch f2fs-fix-to-avoid-panic-in-dec_valid_block_count.patch f2fs-fix-to-use-inline-space-only-if-inline_xattr-is.patch f2fs-fix-to-do-sanity-check-on-valid-block-count-of-.patch -f2fs-fix-to-do-checksum-even-if-inode-page-is-uptoda.patch percpu-remove-spurious-lock-dependency-between-percp.patch configfs-fix-possible-use-after-free-in-configfs_reg.patch uml-fix-a-boot-splat-wrt-use-of-cpu_all_mask.patch |