linux/fs/cifs
Paul Aurich 7a991df9e5 cifs: Fix leak when handling lease break for cached root fid
commit baf57b56d3 upstream.

Handling a lease break for the cached root didn't free the
smb2_lease_break_work allocation, resulting in a leak:

    unreferenced object 0xffff98383a5af480 (size 128):
      comm "cifsd", pid 684, jiffies 4294936606 (age 534.868s)
      hex dump (first 32 bytes):
        c0 ff ff ff 1f 00 00 00 88 f4 5a 3a 38 98 ff ff  ..........Z:8...
        88 f4 5a 3a 38 98 ff ff 80 88 d6 8a ff ff ff ff  ..Z:8...........
      backtrace:
        [<0000000068957336>] smb2_is_valid_oplock_break+0x1fa/0x8c0
        [<0000000073b70b9e>] cifs_demultiplex_thread+0x73d/0xcc0
        [<00000000905fa372>] kthread+0x11c/0x150
        [<0000000079378e4e>] ret_from_fork+0x22/0x30

Avoid this leak by only allocating when necessary.

Fixes: a93864d939 ("cifs: add lease tracking to the cached root fid")
Signed-off-by: Paul Aurich <paul@darkrain42.org>
CC: Stable <stable@vger.kernel.org> # v4.18+
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-21 13:05:24 +02:00
..
Kconfig
Makefile
asn1.c
cache.c
cifs_debug.c
cifs_debug.h
cifs_dfs_ref.c
cifs_fs_sb.h
cifs_ioctl.h
cifs_spnego.c
cifs_spnego.h
cifs_unicode.c
cifs_unicode.h
cifs_uniupr.h
cifsacl.c
cifsacl.h
cifsencrypt.c
cifsfs.c
cifsfs.h
cifsglob.h
cifspdu.h
cifsproto.h
cifsroot.c
cifssmb.c cifs: fix leaked reference on requeued write 2020-05-20 08:20:34 +02:00
connect.c SMB3: Honor 'handletimeout' flag for multiuser mounts 2020-07-09 09:37:55 +02:00
dfs_cache.c
dfs_cache.h
dir.c
dns_resolve.c
dns_resolve.h
export.c
file.c cifs: Fix null pointer check in cifs_read 2020-06-03 08:21:14 +02:00
fscache.c
fscache.h
inode.c Revert "cifs: Fix the target file was deleted when rename failed." 2020-07-29 10:18:41 +02:00
ioctl.c
link.c
misc.c
netmisc.c
nterr.c
nterr.h
ntlmssp.h
readdir.c
rfc1002pdu.h
sess.c
smb1ops.c
smb2file.c
smb2glob.h
smb2inode.c
smb2maperror.c
smb2misc.c cifs: Fix leak when handling lease break for cached root fid 2020-08-21 13:05:24 +02:00
smb2ops.c cifs/smb3: Fix data inconsistent when zero file range 2020-06-30 15:36:51 -04:00
smb2pdu.c smb3: warn on confusing error scenario with sec=krb5 2020-08-21 13:05:19 +02:00
smb2pdu.h
smb2proto.h
smb2status.h
smb2transport.c
smbdirect.c
smbdirect.h
smbencrypt.c
smberr.h
smbfsctl.h
trace.c
trace.h
transport.c cifs: prevent truncation from long to int in wait_for_free_credits 2020-07-22 09:32:52 +02:00
winucase.c
xattr.c