diff options
author | Xiyu Yang <xiyuyang19@fudan.edu.cn> | 2020-06-13 20:27:09 +0800 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-06-21 22:34:50 -0500 |
commit | 77577de64167aa0643d47ffbaacf3642632b321b (patch) | |
tree | 716a34f394299cd51aa264953a0614e6f6405dbd /arch/x86/include | |
parent | 48778464bb7d346b47157d21ffde2af6b2d39110 (diff) | |
download | linux-77577de64167aa0643d47ffbaacf3642632b321b.tar.bz2 |
cifs: Fix cached_fid refcnt leak in open_shroot
open_shroot() invokes kref_get(), which increases the refcount of the
"tcon->crfid" object. When open_shroot() returns not zero, it means the
open operation failed and close_shroot() will not be called to decrement
the refcount of the "tcon->crfid".
The reference counting issue happens in one normal path of
open_shroot(). When the cached root have been opened successfully in a
concurrent process, the function increases the refcount and jump to
"oshr_free" to return. However the current return value "rc" may not
equal to 0, thus the increased refcount will not be balanced outside the
function, causing a refcnt leak.
Fix this issue by setting the value of "rc" to 0 before jumping to
"oshr_free" label.
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Diffstat (limited to 'arch/x86/include')
0 files changed, 0 insertions, 0 deletions