Blame SOURCES/0020-exfat-fix-possible-memory-leak-in-exfat_find.patch
|
Kmods SIG |
50e2b3 |
From 94182167ec730dadcaea5fbc6bb8f1136966ef66 Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
50e2b3 |
From: Wei Yongjun <weiyongjun1@huawei.com>
|
|
Kmods SIG |
50e2b3 |
Date: Wed, 6 May 2020 14:25:54 +0000
|
|
Kmods SIG |
50e2b3 |
Subject: [Backport 94182167ec73] exfat: fix possible memory leak in
|
|
Kmods SIG |
50e2b3 |
exfat_find()
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
'es' is malloced from exfat_get_dentry_set() in exfat_find() and should
|
|
Kmods SIG |
50e2b3 |
be freed before leaving from the error handling cases, otherwise it will
|
|
Kmods SIG |
50e2b3 |
cause memory leak.
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
Fixes: 5f2aa075070c ("exfat: add inode operations")
|
|
Kmods SIG |
50e2b3 |
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
|
|
Kmods SIG |
50e2b3 |
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
|
|
Kmods SIG |
50e2b3 |
---
|
|
Kmods SIG |
50e2b3 |
src/namei.c | 1 +
|
|
Kmods SIG |
50e2b3 |
1 file changed, 1 insertion(+)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/namei.c b/src/namei.c
|
|
Kmods SIG |
50e2b3 |
index b72d782568b811ece222db0dd3575fd8bf2c958a..a2659a8a68a14273eeff16dd467d771ebe038b43 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/namei.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/namei.c
|
|
Kmods SIG |
50e2b3 |
@@ -692,6 +692,7 @@ static int exfat_find(struct inode *dir, struct qstr *qname,
|
|
Kmods SIG |
50e2b3 |
exfat_fs_error(sb,
|
|
Kmods SIG |
50e2b3 |
"non-zero size file starts with zero cluster (size : %llu, p_dir : %u, entry : 0x%08x)",
|
|
Kmods SIG |
50e2b3 |
i_size_read(dir), ei->dir.dir, ei->entry);
|
|
Kmods SIG |
50e2b3 |
+ kfree(es);
|
|
Kmods SIG |
50e2b3 |
return -EIO;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
--
|
|
Kmods SIG |
50e2b3 |
2.31.1
|
|
Kmods SIG |
50e2b3 |
|