Linux-f2fs-devel Archive on
 help / color / Atom feed
* [f2fs-dev] [PATCH] f2fs: fix to verify tpage before releasing in f2fs_free_dic()
@ 2020-03-26  9:42 Chao Yu
  0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2020-03-26  9:42 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

In below error path, tpages[i] could be NULL, fix to check it before
releasing it.
- f2fs_read_multi_pages
 - f2fs_alloc_dic
  - f2fs_free_dic

Fixes: 61fbae2b2b12 ("f2fs: fix to avoid NULL pointer dereference")
Signed-off-by: Chao Yu <>
 fs/f2fs/compress.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index 1d692108dbbb..8d025fe6d60c 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -1339,6 +1339,8 @@ void f2fs_free_dic(struct decompress_io_ctx *dic)
 		for (i = 0; i < dic->cluster_size; i++) {
 			if (dic->rpages[i])
+			if (!dic->tpages[i])
+				continue;

Linux-f2fs-devel mailing list

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26  9:42 [f2fs-dev] [PATCH] f2fs: fix to verify tpage before releasing in f2fs_free_dic() Chao Yu

Linux-f2fs-devel Archive on

Archives are clonable:
	git clone --mirror linux-f2fs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-f2fs-devel linux-f2fs-devel/ \
	public-inbox-index linux-f2fs-devel

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone