android_kernel_motorola_sm6375/fs/ubifs
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mårten Lindahl 823f554747 ubifs: Free memory for tmpfile name
commit 1fb815b38bb31d6af9bd0540b8652a0d6fe6cfd3 upstream.

When opening a ubifs tmpfile on an encrypted directory, function
fscrypt_setup_filename allocates memory for the name that is to be
stored in the directory entry, but after the name has been copied to the
directory entry inode, the memory is not freed.

When running kmemleak on it we see that it is registered as a leak. The
report below is triggered by a simple program 'tmpfile' just opening a
tmpfile:

  unreferenced object 0xffff88810178f380 (size 32):
    comm "tmpfile", pid 509, jiffies 4294934744 (age 1524.742s)
    backtrace:
      __kmem_cache_alloc_node
      __kmalloc
      fscrypt_setup_filename
      ubifs_tmpfile
      vfs_tmpfile
      path_openat

Free this memory after it has been copied to the inode.

Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-17 11:35:34 +02:00
..
auth.c
budget.c ubifs: Reserve one leb for each journal head while doing budget 2023-03-11 16:44:09 +01:00
commit.c
compress.c
crypto.c
debug.c
debug.h
dir.c ubifs: Free memory for tmpfile name 2023-05-17 11:35:34 +02:00
file.c ubifs: ubifs_writepage: Mark page dirty after writing inode failed 2023-03-11 16:44:10 +01:00
find.c
gc.c
io.c ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock() 2022-04-15 14:18:28 +02:00
ioctl.c ubifs: setflags: Make dirtied_ino_d 8 bytes aligned 2022-04-15 14:18:28 +02:00
journal.c
Kconfig
key.h
log.c
lprops.c
lpt.c
lpt_commit.c
Makefile
master.c
misc.c
misc.h
orphan.c
recovery.c
replay.c
sb.c
scan.c
shrinker.c
super.c ubifs: Fix memory leak in alloc_wbufs() 2023-03-11 16:44:09 +01:00
tnc.c ubifs: Fix memleak when insert_old_idx() failed 2023-05-17 11:35:34 +02:00
tnc_commit.c
tnc_misc.c
ubifs-media.h
ubifs.h ubifs: Fix build errors as symbol undefined 2023-03-11 16:44:08 +01:00
xattr.c ubifs: Fix races between xattr_{set|get} and listxattr operations 2021-07-19 08:53:16 +02:00