All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: trond.myklebust@primarydata.com, green@linuxhacker.ru,
	gregkh@linuxfoundation.org, tibbs@math.uh.edu
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "SUNRPC: Fix infinite looping in rpc_clnt_iterate_for_each_xprt" has been added to the 4.7-stable tree
Date: Mon, 05 Sep 2016 16:29:26 +0200	[thread overview]
Message-ID: <1473085766243131@kroah.com> (raw)


This is a note to let you know that I've just added the patch titled

    SUNRPC: Fix infinite looping in rpc_clnt_iterate_for_each_xprt

to the 4.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sunrpc-fix-infinite-looping-in-rpc_clnt_iterate_for_each_xprt.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From bdc54d8e3cb4a41dddcabfd86d9eb3aa5f622b75 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <trond.myklebust@primarydata.com>
Date: Sat, 16 Jul 2016 11:47:00 -0400
Subject: SUNRPC: Fix infinite looping in rpc_clnt_iterate_for_each_xprt

From: Trond Myklebust <trond.myklebust@primarydata.com>

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 |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- a/net/sunrpc/xprtmultipath.c
+++ b/net/sunrpc/xprtmultipath.c
@@ -271,14 +271,12 @@ struct rpc_xprt *xprt_iter_next_entry_mu
 		xprt_switch_find_xprt_t find_next)
 {
 	struct rpc_xprt_switch *xps = rcu_dereference(xpi->xpi_xpswitch);
-	struct list_head *head;
 
 	if (xps == NULL)
 		return NULL;
-	head = &xps->xps_xprt_list;
-	if (xps->xps_nxprts < 2)
-		return xprt_switch_find_first_entry(head);
-	return xprt_switch_set_next_cursor(head, &xpi->xpi_cursor, find_next);
+	return xprt_switch_set_next_cursor(&xps->xps_xprt_list,
+			&xpi->xpi_cursor,
+			find_next);
 }
 
 static


Patches currently in stable-queue which might be from trond.myklebust@primarydata.com are

queue-4.7/sunrpc-fix-infinite-looping-in-rpc_clnt_iterate_for_each_xprt.patch
queue-4.7/sunrpc-handle-eaddrnotavail-on-connection-failures.patch
queue-4.7/sunrpc-allow-for-upcalls-for-same-uid-but-different-gss-service.patch

                 reply	other threads:[~2016-09-05 14:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473085766243131@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=green@linuxhacker.ru \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tibbs@math.uh.edu \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.