linux-stable/fs/dlm
Alexander Aring ffb576cbde fs: dlm: fix memory leak when fenced
[ Upstream commit 700ab1c363 ]

I got some kmemleak report when a node was fenced. The user space tool
dlm_controld will therefore run some rmdir() in dlm configfs which was
triggering some memleaks. This patch stores the sps and cms attributes
which stores some handling for subdirectories of the configfs cluster
entry and free them if they get released as the parent directory gets
freed.

unreferenced object 0xffff88810d9e3e00 (size 192):
  comm "dlm_controld", pid 342, jiffies 4294698126 (age 55438.801s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 73 70 61 63 65 73 00 00  ........spaces..
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<00000000db8b640b>] make_cluster+0x5d/0x360
    [<000000006a571db4>] configfs_mkdir+0x274/0x730
    [<00000000b094501c>] vfs_mkdir+0x27e/0x340
    [<0000000058b0adaf>] do_mkdirat+0xff/0x1b0
    [<00000000d1ffd156>] do_syscall_64+0x40/0x80
    [<00000000ab1408c8>] entry_SYSCALL_64_after_hwframe+0x44/0xae
unreferenced object 0xffff88810d9e3a00 (size 192):
  comm "dlm_controld", pid 342, jiffies 4294698126 (age 55438.801s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 63 6f 6d 6d 73 00 00 00  ........comms...
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<00000000a7ef6ad2>] make_cluster+0x82/0x360
    [<000000006a571db4>] configfs_mkdir+0x274/0x730
    [<00000000b094501c>] vfs_mkdir+0x27e/0x340
    [<0000000058b0adaf>] do_mkdirat+0xff/0x1b0
    [<00000000d1ffd156>] do_syscall_64+0x40/0x80
    [<00000000ab1408c8>] entry_SYSCALL_64_after_hwframe+0x44/0xae

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-20 16:17:33 +02:00
..
ast.c dlm: Don't swamp the CPU with callbacks queued during recovery 2019-02-12 19:45:57 +01:00
ast.h
config.c fs: dlm: fix memory leak when fenced 2021-07-20 16:17:33 +02:00
config.h
debug_fs.c fs: dlm: fix debugfs dump 2021-05-22 10:57:35 +02:00
dir.c
dir.h
dlm_internal.h dlm: remove BUG() before panic() 2020-06-25 15:41:52 +02:00
Kconfig
lock.c dlm: memory leaks on error path in dlm_user_request() 2019-01-13 10:01:05 +01:00
lock.h
lockspace.c dlm: Fix kobject memleak 2020-08-21 09:48:13 +02:00
lockspace.h
lowcomms.c fs: dlm: cancel work sync othercon 2021-07-20 16:17:33 +02:00
lowcomms.h
lvb_table.h
main.c dlm: audit and remove any unnecessary uses of module.h 2016-10-19 11:00:03 -05:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
member.c dlm: fix possible call to kfree() for non-initialized pointer 2019-12-17 20:37:41 +01:00
member.h
memory.c dlm: NULL check before kmem_cache_destroy is not needed 2019-12-17 20:38:17 +01:00
memory.h
midcomms.c
midcomms.h
netlink.c dlm for 4.10 2016-12-14 08:31:37 -08:00
plock.c fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks 2017-07-16 10:28:22 -04:00
rcom.c
rcom.h
recover.c
recover.h
recoverd.c
recoverd.h
requestqueue.c
requestqueue.h
user.c dlm: fix invalid cluster name warning 2019-12-17 20:38:33 +01:00
user.h
util.c
util.h