]> git.hungrycats.org Git - linux/commit
SUNRPC: Fix infinite looping in rpc_clnt_iterate_for_each_xprt
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 16 Jul 2016 15:47:00 +0000 (11:47 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Sep 2016 06:34:56 +0000 (08:34 +0200)
commit6b553b7ac74ddc1450e8b0a52dfdcfab9129d4c2
tree5628172ca6c2164df05c5b7b3175016d85eea135
parent95f837790b66c770d94625206e0cc178df984635
SUNRPC: Fix infinite looping in rpc_clnt_iterate_for_each_xprt

commit bdc54d8e3cb4a41dddcabfd86d9eb3aa5f622b75 upstream.

If there were less than 2 entries in the multipath list, then
xprt_iter_next_entry_multiple() would never advance beyond the
first entry, which is correct for round robin behaviour, but not
for the list iteration.

The end result would be infinite looping in rpc_clnt_iterate_for_each_xprt()
as we would never see the xprt == NULL condition fulfilled.

Reported-by: Oleg Drokin <green@linuxhacker.ru>
Fixes: 80b14d5e61ca ("SUNRPC: Add a structure to track multiple transports")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Jason L Tibbitts III <tibbs@math.uh.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/xprtmultipath.c