OSDN Git Service

ANDROID: Revert "f2fs: avoid out-of-range memory access"
authorGreg Kroah-Hartman <gregkh@google.com>
Sun, 4 Aug 2019 08:22:50 +0000 (10:22 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Sun, 4 Aug 2019 08:27:10 +0000 (08:27 +0000)
This reverts commit 77bd558b2a02356a43b6e38de5168c6bb2afe9e8 which is
commit 56f3ce675103e3fb9e631cfb4131fc768bc23e9a upstream.

This is being done because segment.c is a bit "different" in this
branch, and we should keep the f2fs fixes away from here for now.
Otherwise the build breaks.

Change-Id: I014e3381acb1112825f305d47bdf88848ee6fb7f
Cc: Ocean Chen <oceanchen@google.com>
Cc: Jaegeuk Kim <jaegeuk@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
fs/f2fs/segment.c

index a022e2f..1c7b75a 100644 (file)
@@ -3073,11 +3073,6 @@ static void read_compacted_summaries(struct f2fs_sb_info *sbi)
                seg_i = CURSEG_I(sbi, i);
                segno = le32_to_cpu(ckpt->cur_data_segno[i]);
                blk_off = le16_to_cpu(ckpt->cur_data_blkoff[i]);
-               if (blk_off > ENTRIES_IN_SUM) {
-                       f2fs_bug_on(sbi, 1);
-                       f2fs_put_page(page, 1);
-                       return -EFAULT;
-               }
                seg_i->next_segno = segno;
                reset_curseg(sbi, i, 0);
                seg_i->alloc_type = ckpt->alloc_type[i];