mbox series

[v3,0/2] ubifs: Fix two kmemleaks in error path

Message ID 20240108024105.194516-1-chengzhihao1@huawei.com
Headers show
Series ubifs: Fix two kmemleaks in error path | expand

Message

Zhihao Cheng Jan. 8, 2024, 2:41 a.m. UTC
First memleak is found by mounting corrupted UBIFS image with chk_index
enabled.
Second memleak is found by powercut testing for encryption scenario.

v1->v2:
 ubifs_symlink: Call fscrypt_free_inode() directly in error handling path.
 Add 'Cc: stable@vger.kernel.org' and 'Suggested-by' tags in patch 2.
v2->v3:
 Handle tnc releasing in error handling path in dbg_check_idx_size().


Zhihao Cheng (2):
  ubifs: dbg_check_idx_size: Fix kmemleak if loading znode failed
  ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path

 fs/ubifs/debug.c    |  9 +++++++--
 fs/ubifs/dir.c      |  2 ++
 fs/ubifs/tnc.c      |  9 +--------
 fs/ubifs/tnc_misc.c | 22 ++++++++++++++++++++++
 fs/ubifs/ubifs.h    |  1 +
 5 files changed, 33 insertions(+), 10 deletions(-)