WSL2-Linux-Kernel/net/sunrpc
OGAWA Hirofumi a271c5a0de NFS: Ensure that rpc_release_resources_task() can be called twice.
BUG: atomic_dec_and_test(): -1: atomic counter underflow at:
Pid: 2827, comm: mount.nfs Not tainted 2.6.38 #1
Call Trace:
 [<ffffffffa02223a0>] ? put_rpccred+0x44/0x14e [sunrpc]
 [<ffffffffa021bbe9>] ? rpc_ping+0x4e/0x58 [sunrpc]
 [<ffffffffa021c4a5>] ? rpc_create+0x481/0x4fc [sunrpc]
 [<ffffffffa022298a>] ? rpcauth_lookup_credcache+0xab/0x22d [sunrpc]
 [<ffffffffa028be8c>] ? nfs_create_rpc_client+0xa6/0xeb [nfs]
 [<ffffffffa028c660>] ? nfs4_set_client+0xc2/0x1f9 [nfs]
 [<ffffffffa028cd3c>] ? nfs4_create_server+0xf2/0x2a6 [nfs]
 [<ffffffffa0295d07>] ? nfs4_remote_mount+0x4e/0x14a [nfs]
 [<ffffffff810dd570>] ? vfs_kern_mount+0x6e/0x133
 [<ffffffffa029605a>] ? nfs_do_root_mount+0x76/0x95 [nfs]
 [<ffffffffa029643d>] ? nfs4_try_mount+0x56/0xaf [nfs]
 [<ffffffffa0297434>] ? nfs_get_sb+0x435/0x73c [nfs]
 [<ffffffff810dd59b>] ? vfs_kern_mount+0x99/0x133
 [<ffffffff810dd693>] ? do_kern_mount+0x48/0xd8
 [<ffffffff810f5b75>] ? do_mount+0x6da/0x741
 [<ffffffff810f5c5f>] ? sys_mount+0x83/0xc0
 [<ffffffff8100293b>] ? system_call_fastpath+0x16/0x1b

Well, so, I think this is real bug of nfs codes somewhere. With some
review, the code

rpc_call_sync()
    rpc_run_task
        rpc_execute()
            __rpc_execute()
                rpc_release_task()
                    rpc_release_resources_task()
                        put_rpccred()                <= release cred
    rpc_put_task
        rpc_do_put_task()
            rpc_release_resources_task()
                put_rpccred()                        <= release cred again

seems to be release cred unintendedly.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2011-03-27 17:55:36 +02:00
..
auth_gss NFS: Determine initial mount security 2011-03-24 13:52:42 -04:00
xprtrdma SUNRPC: Remove resource leak in svc_rdma_send_error() 2011-03-17 14:38:03 -04:00
Kconfig
Makefile
addr.c
auth.c SUNRPC: New xdr_streams XDR decoder API 2010-12-16 12:37:25 -05:00
auth_generic.c
auth_null.c
auth_unix.c
backchannel_rqst.c
bc_svc.c SUNRPC fix bc_send print 2011-01-06 14:46:23 -05:00
cache.c svcrpc: ensure cache_check caller sees updated entry 2011-01-04 16:49:25 -05:00
clnt.c RPC: killing RPC tasks races fixed 2011-03-17 12:39:00 -04:00
netns.h
rpc_pipe.c Merge branch 'nfs-for-2.6.38' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 2011-01-11 15:11:56 -08:00
rpcb_clnt.c SUNRPC: New xdr_streams XDR decoder API 2010-12-16 12:37:25 -05:00
sched.c NFS: Ensure that rpc_release_resources_task() can be called twice. 2011-03-27 17:55:36 +02:00
socklib.c
stats.c SUNRPC: Simplify rpc_alloc_iostats by removing pointless local variable 2010-11-16 11:58:51 -05:00
sunrpc.h
sunrpc_syms.c
svc.c Merge branch 'for-2.6.38' of git://linux-nfs.org/~bfields/linux 2011-01-14 13:17:26 -08:00
svc_xprt.c rpc: keep backchannel xprt as long as server connection 2011-01-11 15:04:10 -05:00
svcauth.c net: sunrpc: kill unused macros 2010-12-17 15:48:21 -05:00
svcauth_unix.c svcrpc: fix bad argument in unix_domain_find 2011-03-09 22:40:30 -05:00
svcsock.c net: add __rcu annotations to sk_wq and wq 2011-02-22 10:19:31 -08:00
sysctl.c
timer.c
xdr.c NFS: Don't use vm_map_ram() in readdir 2011-01-10 14:45:01 -05:00
xprt.c xprt: remove redundant check 2011-03-17 12:39:00 -04:00
xprtsock.c SUNRPC: Never reuse the socket port after an xs_close() 2011-03-22 18:42:33 -04:00