Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfsd: Fix an Oops in free_session()

In call_xpt_users(), we delete the entry from the list, but we
do not reinitialise it. This triggers the list poisoning when
we later call unregister_xpt_user() in nfsd4_del_conns().

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Trond Myklebust and committed by
J. Bruce Fields
bb6ad557 bd8d7250

+1 -1
+1 -1
net/sunrpc/svc_xprt.c
··· 989 989 spin_lock(&xprt->xpt_lock); 990 990 while (!list_empty(&xprt->xpt_users)) { 991 991 u = list_first_entry(&xprt->xpt_users, struct svc_xpt_user, list); 992 - list_del(&u->list); 992 + list_del_init(&u->list); 993 993 u->callback(u); 994 994 } 995 995 spin_unlock(&xprt->xpt_lock);