* Patch "sctp: disable BH in sctp_for_each_endpoint" has been added to the 4.9-stable tree
@ 2017-06-29 16:59 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-06-29 16:59 UTC (permalink / raw)
To: lucien.xin, davem, gregkh, marcelo.leitner, xmu; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
sctp: disable BH in sctp_for_each_endpoint
to the 4.9-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:
sctp-disable-bh-in-sctp_for_each_endpoint.patch
and it can be found in the queue-4.9 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 foo@baz Thu Jun 29 18:57:46 CEST 2017
From: Xin Long <lucien.xin@gmail.com>
Date: Sat, 10 Jun 2017 14:48:14 +0800
Subject: sctp: disable BH in sctp_for_each_endpoint
From: Xin Long <lucien.xin@gmail.com>
[ Upstream commit 581409dacc9176b0de1f6c4ca8d66e13aa8e1b29 ]
Now sctp holds read_lock when foreach sctp_ep_hashtable without disabling
BH. If CPU schedules to another thread A at this moment, the thread A may
be trying to hold the write_lock with disabling BH.
As BH is disabled and CPU cannot schedule back to the thread holding the
read_lock, while the thread A keeps waiting for the read_lock. A dead
lock would be triggered by this.
This patch is to fix this dead lock by calling read_lock_bh instead to
disable BH when holding the read_lock in sctp_for_each_endpoint.
Fixes: 626d16f50f39 ("sctp: export some apis or variables for sctp_diag and reuse some for proc")
Reported-by: Xiumei Mu <xmu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/socket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4460,13 +4460,13 @@ int sctp_for_each_endpoint(int (*cb)(str
for (head = sctp_ep_hashtable; hash < sctp_ep_hashsize;
hash++, head++) {
- read_lock(&head->lock);
+ read_lock_bh(&head->lock);
sctp_for_each_hentry(epb, &head->chain) {
err = cb(sctp_ep(epb), p);
if (err)
break;
}
- read_unlock(&head->lock);
+ read_unlock_bh(&head->lock);
}
return err;
Patches currently in stable-queue which might be from lucien.xin@gmail.com are
queue-4.9/ipv6-fix-calling-in6_ifa_hold-incorrectly-for-dad-work.patch
queue-4.9/igmp-acquire-pmc-lock-for-ip_mc_clear_src.patch
queue-4.9/sctp-return-next-obj-by-passing-pos-1-into-sctp_transport_get_idx.patch
queue-4.9/sctp-disable-bh-in-sctp_for_each_endpoint.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-29 17:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29 16:59 Patch "sctp: disable BH in sctp_for_each_endpoint" has been added to the 4.9-stable tree gregkh
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.