]> www.infradead.org Git - users/dwmw2/linux.git/commit
nfsd: Fix svc_xprt refcnt leak when setup callback client failed
authorXiyu Yang <xiyuyang19@fudan.edu.cn>
Mon, 25 May 2020 14:15:41 +0000 (22:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:28 +0000 (17:48 +0200)
commitc745f9ef3c8cbae70556131eaeaf0f64510243b7
tree0478c2b657b6ee122a7938232e7bcf71b79ea6f2
parent3be21617fc451ed59bcf7a6275a7565c35471099
nfsd: Fix svc_xprt refcnt leak when setup callback client failed

[ Upstream commit a4abc6b12eb1f7a533c2e7484cfa555454ff0977 ]

nfsd4_process_cb_update() invokes svc_xprt_get(), which increases the
refcount of the "c->cn_xprt".

The reference counting issue happens in one exception handling path of
nfsd4_process_cb_update(). When setup callback client failed, the
function forgets to decrease the refcnt increased by svc_xprt_get(),
causing a refcnt leak.

Fix this issue by calling svc_xprt_put() when setup callback client
failed.

Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfs4callback.c