From: Greg Kroah-Hartman Date: Sun, 4 Aug 2019 08:22:50 +0000 (+0200) Subject: ANDROID: Revert "f2fs: avoid out-of-range memory access" X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=78a688fa830a4e9ff49de221ccc64bc26e54c531;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git ANDROID: Revert "f2fs: avoid out-of-range memory access" 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 Cc: Jaegeuk Kim Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index a022e2f9faf1..1c7b75a760da 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -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];