mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-20 01:24:39 +08:00
d508ee2dd5
When an instance is removed, the top level files of the eventfs directory
are not cleaned up. Call the eventfs_remove() on each of the entries to
free them.
This was found via kmemleak:
unreferenced object 0xffff8881047c1280 (size 96):
comm "mkdir", pid 924, jiffies 4294906489 (age 2013.077s)
hex dump (first 32 bytes):
18 31 ed 03 81 88 ff ff 00 31 09 24 81 88 ff ff .1.......1.$....
00 00 00 00 00 00 00 00 98 19 7c 04 81 88 ff ff ..........|.....
backtrace:
[<000000000fa46b4d>] kmalloc_trace+0x2a/0xa0
[<00000000e729cd0c>] eventfs_prepare_ef.constprop.0+0x3a/0x160
[<000000009032e6a8>] eventfs_add_events_file+0xa0/0x160
[<00000000fe968442>] create_event_toplevel_files+0x6f/0x130
[<00000000e364d173>] event_trace_add_tracer+0x14/0x140
[<00000000411840fa>] trace_array_create_dir+0x52/0xf0
[<00000000967804fa>] trace_array_create+0x208/0x370
[<00000000da505565>] instance_mkdir+0x6b/0xb0
[<00000000dc1215af>] tracefs_syscall_mkdir+0x5b/0x90
[<00000000a8aca289>] vfs_mkdir+0x272/0x380
[<000000007709b242>] do_mkdirat+0xfc/0x1d0
[<00000000c0b6d219>] __x64_sys_mkdir+0x78/0xa0
[<0000000097b5dd4b>] do_syscall_64+0x3f/0x90
[<00000000a3f00cfa>] entry_SYSCALL_64_after_hwframe+0x6e/0xd8
unreferenced object 0xffff888103ed3118 (size 8):
comm "mkdir", pid 924, jiffies 4294906489 (age 2013.077s)
hex dump (first 8 bytes):
65 6e 61 62 6c 65 00 00 enable..
backtrace:
[<0000000010f75127>] __kmalloc_node_track_caller+0x51/0x160
[<000000004b3eca91>] kstrdup+0x34/0x60
[<0000000050074d7a>] eventfs_prepare_ef.constprop.0+0x53/0x160
[<000000009032e6a8>] eventfs_add_events_file+0xa0/0x160
[<00000000fe968442>] create_event_toplevel_files+0x6f/0x130
[<00000000e364d173>] event_trace_add_tracer+0x14/0x140
[<00000000411840fa>] trace_array_create_dir+0x52/0xf0
[<00000000967804fa>] trace_array_create+0x208/0x370
[<00000000da505565>] instance_mkdir+0x6b/0xb0
[<00000000dc1215af>] tracefs_syscall_mkdir+0x5b/0x90
[<00000000a8aca289>] vfs_mkdir+0x272/0x380
[<000000007709b242>] do_mkdirat+0xfc/0x1d0
[<00000000c0b6d219>] __x64_sys_mkdir+0x78/0xa0
[<0000000097b5dd4b>] do_syscall_64+0x3f/0x90
[<00000000a3f00cfa>] entry_SYSCALL_64_after_hwframe+0x6e/0xd8
Link: https://lore.kernel.org/linux-trace-kernel/20230907175859.6fedbaa2@gandalf.local.home
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ajay Kaher <akaher@vmware.com>
Cc: Zheng Yejian <zhengyejian1@huawei.com>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Fixes:
|
||
---|---|---|
.. | ||
9p | ||
adfs | ||
affs | ||
afs | ||
autofs | ||
befs | ||
bfs | ||
btrfs | ||
cachefiles | ||
ceph | ||
coda | ||
configfs | ||
cramfs | ||
crypto | ||
debugfs | ||
devpts | ||
dlm | ||
ecryptfs | ||
efivarfs | ||
efs | ||
erofs | ||
exfat | ||
exportfs | ||
ext2 | ||
ext4 | ||
f2fs | ||
fat | ||
freevxfs | ||
fscache | ||
fuse | ||
gfs2 | ||
hfs | ||
hfsplus | ||
hostfs | ||
hpfs | ||
hugetlbfs | ||
iomap | ||
isofs | ||
jbd2 | ||
jffs2 | ||
jfs | ||
kernfs | ||
lockd | ||
minix | ||
netfs | ||
nfs | ||
nfs_common | ||
nfsd | ||
nilfs2 | ||
nls | ||
notify | ||
ntfs | ||
ntfs3 | ||
ocfs2 | ||
omfs | ||
openpromfs | ||
orangefs | ||
overlayfs | ||
proc | ||
pstore | ||
qnx4 | ||
qnx6 | ||
quota | ||
ramfs | ||
reiserfs | ||
romfs | ||
smb | ||
squashfs | ||
sysfs | ||
sysv | ||
tracefs | ||
ubifs | ||
udf | ||
ufs | ||
unicode | ||
vboxsf | ||
verity | ||
xfs | ||
zonefs | ||
aio.c | ||
anon_inodes.c | ||
attr.c | ||
bad_inode.c | ||
binfmt_elf_fdpic.c | ||
binfmt_elf_test.c | ||
binfmt_elf.c | ||
binfmt_flat.c | ||
binfmt_misc.c | ||
binfmt_script.c | ||
buffer.c | ||
char_dev.c | ||
compat_binfmt_elf.c | ||
coredump.c | ||
d_path.c | ||
dax.c | ||
dcache.c | ||
direct-io.c | ||
drop_caches.c | ||
eventfd.c | ||
eventpoll.c | ||
exec.c | ||
fcntl.c | ||
fhandle.c | ||
file_table.c | ||
file.c | ||
filesystems.c | ||
fs_context.c | ||
fs_parser.c | ||
fs_pin.c | ||
fs_struct.c | ||
fs_types.c | ||
fs-writeback.c | ||
fsopen.c | ||
init.c | ||
inode.c | ||
internal.h | ||
ioctl.c | ||
Kconfig | ||
Kconfig.binfmt | ||
kernel_read_file.c | ||
libfs.c | ||
locks.c | ||
Makefile | ||
mbcache.c | ||
mnt_idmapping.c | ||
mount.h | ||
mpage.c | ||
namei.c | ||
namespace.c | ||
nsfs.c | ||
open.c | ||
pipe.c | ||
pnode.c | ||
pnode.h | ||
posix_acl.c | ||
proc_namespace.c | ||
read_write.c | ||
readdir.c | ||
remap_range.c | ||
select.c | ||
seq_file.c | ||
signalfd.c | ||
splice.c | ||
stack.c | ||
stat.c | ||
statfs.c | ||
super.c | ||
sync.c | ||
sysctls.c | ||
timerfd.c | ||
userfaultfd.c | ||
utimes.c | ||
xattr.c |