* [PATCH 1/2] fsck.f2fs: fix memory leak caused by fsck_chk_orphan_node() [not found] <CGME20210510085419epcas1p1e16c3966fc1b7b9f28a797eaa588f3ba@epcas1p1.samsung.com> @ 2021-05-10 8:57 ` Seung-Woo Kim 0 siblings, 0 replies; 8+ messages in thread From: Seung-Woo Kim @ 2021-05-10 8:57 UTC (permalink / raw) To: jaegeuk, linux-f2fs-devel; +Cc: linux-kernel, chao, sw0312.kim With invalid node info from fsck_chk_orphan_node(), orphan_blk and new_blk are not freed. Fix memory leak in the path. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> --- fsck/fsck.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index e52672032d2c..6019775dcb2d 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -1780,8 +1780,11 @@ int fsck_chk_orphan_node(struct f2fs_sb_info *sbi) if (c.preen_mode == PREEN_MODE_1 && !c.fix_on) { get_node_info(sbi, ino, &ni); if (!IS_VALID_NID(sbi, ino) || - !IS_VALID_BLK_ADDR(sbi, ni.blk_addr)) + !IS_VALID_BLK_ADDR(sbi, ni.blk_addr)) { + free(orphan_blk); + free(new_blk); return -EINVAL; + } continue; } -- 2.19.2 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix memory leak caused by fsck_chk_orphan_node() @ 2021-05-10 8:57 ` Seung-Woo Kim 0 siblings, 0 replies; 8+ messages in thread From: Seung-Woo Kim @ 2021-05-10 8:57 UTC (permalink / raw) To: jaegeuk, linux-f2fs-devel; +Cc: sw0312.kim, linux-kernel With invalid node info from fsck_chk_orphan_node(), orphan_blk and new_blk are not freed. Fix memory leak in the path. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> --- fsck/fsck.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index e52672032d2c..6019775dcb2d 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -1780,8 +1780,11 @@ int fsck_chk_orphan_node(struct f2fs_sb_info *sbi) if (c.preen_mode == PREEN_MODE_1 && !c.fix_on) { get_node_info(sbi, ino, &ni); if (!IS_VALID_NID(sbi, ino) || - !IS_VALID_BLK_ADDR(sbi, ni.blk_addr)) + !IS_VALID_BLK_ADDR(sbi, ni.blk_addr)) { + free(orphan_blk); + free(new_blk); return -EINVAL; + } continue; } -- 2.19.2 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply related [flat|nested] 8+ messages in thread
[parent not found: <CGME20210510085419epcas1p3e72ea9d956bcf811167b14e06fb08149@epcas1p3.samsung.com>]
* [PATCH 2/2] dump.f2fs: fix memory leak caused by dump_node_blk() [not found] ` <CGME20210510085419epcas1p3e72ea9d956bcf811167b14e06fb08149@epcas1p3.samsung.com> @ 2021-05-10 8:57 ` Seung-Woo Kim 0 siblings, 0 replies; 8+ messages in thread From: Seung-Woo Kim @ 2021-05-10 8:57 UTC (permalink / raw) To: jaegeuk, linux-f2fs-devel; +Cc: linux-kernel, chao, sw0312.kim Fix to free node_blk when nid is 0 from dump_node_blk(). Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> --- fsck/dump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fsck/dump.c b/fsck/dump.c index 055ce09bb1cf..042a2e52edca 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -278,7 +278,7 @@ static void dump_node_blk(struct f2fs_sb_info *sbi, int ntype, if (nid == 0) { *ofs += skip; - return; + goto out; } for (i = 0; i < idx; i++, (*ofs)++) { @@ -297,6 +297,7 @@ static void dump_node_blk(struct f2fs_sb_info *sbi, int ntype, break; } } +out: free(node_blk); } -- 2.19.2 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [f2fs-dev] [PATCH 2/2] dump.f2fs: fix memory leak caused by dump_node_blk() @ 2021-05-10 8:57 ` Seung-Woo Kim 0 siblings, 0 replies; 8+ messages in thread From: Seung-Woo Kim @ 2021-05-10 8:57 UTC (permalink / raw) To: jaegeuk, linux-f2fs-devel; +Cc: sw0312.kim, linux-kernel Fix to free node_blk when nid is 0 from dump_node_blk(). Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> --- fsck/dump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fsck/dump.c b/fsck/dump.c index 055ce09bb1cf..042a2e52edca 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -278,7 +278,7 @@ static void dump_node_blk(struct f2fs_sb_info *sbi, int ntype, if (nid == 0) { *ofs += skip; - return; + goto out; } for (i = 0; i < idx; i++, (*ofs)++) { @@ -297,6 +297,7 @@ static void dump_node_blk(struct f2fs_sb_info *sbi, int ntype, break; } } +out: free(node_blk); } -- 2.19.2 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [f2fs-dev] [PATCH 2/2] dump.f2fs: fix memory leak caused by dump_node_blk() 2021-05-10 8:57 ` [f2fs-dev] " Seung-Woo Kim @ 2021-05-11 3:19 ` Chao Yu -1 siblings, 0 replies; 8+ messages in thread From: Chao Yu @ 2021-05-11 3:19 UTC (permalink / raw) To: Seung-Woo Kim, jaegeuk, linux-f2fs-devel; +Cc: linux-kernel On 2021/5/10 16:57, Seung-Woo Kim wrote: > Fix to free node_blk when nid is 0 from dump_node_blk(). > > Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Thanks, ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [f2fs-dev] [PATCH 2/2] dump.f2fs: fix memory leak caused by dump_node_blk() @ 2021-05-11 3:19 ` Chao Yu 0 siblings, 0 replies; 8+ messages in thread From: Chao Yu @ 2021-05-11 3:19 UTC (permalink / raw) To: Seung-Woo Kim, jaegeuk, linux-f2fs-devel; +Cc: linux-kernel On 2021/5/10 16:57, Seung-Woo Kim wrote: > Fix to free node_blk when nid is 0 from dump_node_blk(). > > Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix memory leak caused by fsck_chk_orphan_node() 2021-05-10 8:57 ` [f2fs-dev] " Seung-Woo Kim @ 2021-05-11 3:18 ` Chao Yu -1 siblings, 0 replies; 8+ messages in thread From: Chao Yu @ 2021-05-11 3:18 UTC (permalink / raw) To: Seung-Woo Kim, jaegeuk, linux-f2fs-devel; +Cc: linux-kernel On 2021/5/10 16:57, Seung-Woo Kim wrote: > With invalid node info from fsck_chk_orphan_node(), orphan_blk > and new_blk are not freed. Fix memory leak in the path. > > Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Thanks, ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix memory leak caused by fsck_chk_orphan_node() @ 2021-05-11 3:18 ` Chao Yu 0 siblings, 0 replies; 8+ messages in thread From: Chao Yu @ 2021-05-11 3:18 UTC (permalink / raw) To: Seung-Woo Kim, jaegeuk, linux-f2fs-devel; +Cc: linux-kernel On 2021/5/10 16:57, Seung-Woo Kim wrote: > With invalid node info from fsck_chk_orphan_node(), orphan_blk > and new_blk are not freed. Fix memory leak in the path. > > Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-05-11 3:19 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <CGME20210510085419epcas1p1e16c3966fc1b7b9f28a797eaa588f3ba@epcas1p1.samsung.com> 2021-05-10 8:57 ` [PATCH 1/2] fsck.f2fs: fix memory leak caused by fsck_chk_orphan_node() Seung-Woo Kim 2021-05-10 8:57 ` [f2fs-dev] " Seung-Woo Kim [not found] ` <CGME20210510085419epcas1p3e72ea9d956bcf811167b14e06fb08149@epcas1p3.samsung.com> 2021-05-10 8:57 ` [PATCH 2/2] dump.f2fs: fix memory leak caused by dump_node_blk() Seung-Woo Kim 2021-05-10 8:57 ` [f2fs-dev] " Seung-Woo Kim 2021-05-11 3:19 ` Chao Yu 2021-05-11 3:19 ` Chao Yu 2021-05-11 3:18 ` [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix memory leak caused by fsck_chk_orphan_node() Chao Yu 2021-05-11 3:18 ` Chao Yu
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.