Catalin Marinas
3028efe03b
NFS: Fix nfs4_lock_state refcounting in nfs4_alloc_{lock,unlock}data()
...
Commit 7b587e1a5a ("NFS: use locks_copy_lock() to copy locks.")
changed the lock copying from memcpy() to the dedicated
locks_copy_lock() function. The latter correctly increments the
nfs4_lock_state.ls_count via nfs4_fl_copy_lock(), however, this refcount
has already been incremented in the nfs4_alloc_{lock,unlock}data().
Kmemleak subsequently reports an unreferenced nfs4_lock_state object as
below (arm64 platform):
unreferenced object 0xffff8000fce0b000 (size 256):
comm "systemd-sysuser", pid 1608, jiffies 4294892825 (age 32.348s)
hex dump (first 32 bytes):
20 57 4c fb 00 80 ff ff 20 57 4c fb 00 80 ff ff WL..... WL.....
00 57 4c fb 00 80 ff ff 01 00 00 00 00 00 00 00 .WL.............
backtrace:
[<000000000d15010d>] kmem_cache_alloc+0x178/0x208
[<00000000d7c1d264>] nfs4_set_lock_state+0x124/0x1f0
[<000000009c867628>] nfs4_proc_lock+0x90/0x478
[<000000001686bd74>] do_setlk+0x64/0xe8
[<00000000e01500d4>] nfs_lock+0xe8/0x1f0
[<000000004f387d8d>] vfs_lock_file+0x18/0x40
[<00000000656ab79b>] do_lock_file_wait+0x68/0xf8
[<00000000f17c4a4b>] fcntl_setlk+0x224/0x280
[<0000000052a242c6>] do_fcntl+0x418/0x730
[<000000004f47291a>] __arm64_sys_fcntl+0x84/0xd0
[<00000000d6856e01>] el0_svc_common+0x80/0xf0
[<000000009c4bd1df>] el0_svc_handler+0x2c/0x80
[<00000000b1a0d479>] el0_svc+0x8/0xc
[<0000000056c62a0f>] 0xffffffffffffffff
This patch removes the original refcount_inc(&lsp->ls_count) that was
paired with the memcpy() lock copying.
Fixes: 7b587e1a5a ("NFS: use locks_copy_lock() to copy locks.")
Cc: <stable@vger.kernel.org> # 5.0.x-
Cc: NeilBrown <neilb@suse.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
2019-03-18 13:14:24 -04:00
arch
Kbuild updates for v5.1 (2nd)
2019-03-17 13:25:26 -07:00
block
for-5.1/block-post-20190315
2019-03-16 12:36:39 -07:00
certs
kexec, KEYS: Make use of platform keyring for signature verify
2019-02-04 17:34:07 -05:00
crypto
lib/lzo: separate lzo-rle from lzo
2019-03-07 18:32:03 -08:00
Documentation
Kbuild updates for v5.1 (2nd)
2019-03-17 13:25:26 -07:00
drivers
xen: one further fix for v5.1-rc1
2019-03-17 09:16:22 -07:00
fs
NFS: Fix nfs4_lock_state refcounting in nfs4_alloc_{lock,unlock}data()
2019-03-18 13:14:24 -04:00
include
Kbuild updates for v5.1 (2nd)
2019-03-17 13:25:26 -07:00
init
init/main: add checks for the return value of memblock_alloc*()
2019-03-12 10:04:02 -07:00
ipc
Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2019-03-12 14:08:19 -07:00
kernel
pidfd patches for v5.1-rc1
2019-03-16 13:47:14 -07:00
lib
Kbuild updates for v5.1 (2nd)
2019-03-17 13:25:26 -07:00
LICENSES
LICENSES: Add GCC runtime library exception text
2019-01-16 14:54:15 -07:00
mm
device-dax for 5.1
2019-03-16 13:05:32 -07:00
net
Pull request for inlusion in 5.1
2019-03-17 09:10:56 -07:00
samples
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2019-03-11 08:54:01 -07:00
scripts
kconfig: remove stale lxdialog/.gitignore
2019-03-17 15:47:02 +09:00
security
selinux/stable-5.1 PR 20190312
2019-03-13 11:10:42 -07:00
sound
sound fixes for 5.1-rc1
2019-03-15 14:05:00 -07:00
tools
pidfd patches for v5.1-rc1
2019-03-16 13:47:14 -07:00
usr
user/Makefile: Fix typo and capitalization in comment section
2018-12-11 00:18:03 +09:00
virt
ARM: some cleanups, direct physical timer assignment, cache sanitization
2019-03-15 15:00:28 -07:00
.clang-format
Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2019-03-12 13:43:42 -07:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
kbuild: Add support for DT binding schema checks
2018-12-13 09:41:32 -06:00
.mailmap
.mailmap: Add Mathieu Othacehe
2019-02-21 11:41:19 +00:00
COPYING
CREDITS
Char/Misc driver patches for 5.1-rc1
2019-03-06 14:18:59 -08:00
Kbuild
Kbuild updates for v5.1
2019-03-10 17:48:21 -07:00
Kconfig
kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt
2018-08-02 08:06:55 +09:00
MAINTAINERS
ARM: some cleanups, direct physical timer assignment, cache sanitization
2019-03-15 15:00:28 -07:00
Makefile
Linux 5.1-rc1
2019-03-17 14:22:26 -07:00
README
Drop all 00-INDEX files from Documentation/
2018-09-09 15:08:58 -06:00