summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2017-05-11 21:28:15 +0300
committerDavid S. Miller <davem@davemloft.net>2017-05-12 05:19:30 +0300
commit844cf763fba654436d3a4279b6a672c196cf1901 (patch)
tree60dc21eb9e82310b9267805b12f88fa07ae9f925 /ipc
parentad990dbe6d3ac3af1f5f4484b1126b9fc601e98a (diff)
downloadlinux-844cf763fba654436d3a4279b6a672c196cf1901.tar.xz
tipc: make macro tipc_wait_for_cond() smp safe
The macro tipc_wait_for_cond() is embedding the macro sk_wait_event() to fulfil its task. The latter, in turn, is evaluating the stated condition outside the socket lock context. This is problematic if the condition is accessing non-trivial data structures which may be altered by incoming interrupts, as is the case with the cong_links() linked list, used by socket to keep track of the current set of congested links. We sometimes see crashes when this list is accessed by a condition function at the same time as a SOCK_WAKEUP interrupt is removing an element from the list. We fix this by expanding selected parts of sk_wait_event() into the outer macro, while ensuring that all evaluations of a given condition are performed under socket lock protection. Fixes: commit 365ad353c256 ("tipc: reduce risk of user starvation during link congestion") Reviewed-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions