summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHoang Le <hoang.h.le@dektech.com.au>2021-09-13 16:28:52 +0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-22 11:45:33 +0200
commitadc7f7c53219f8e0430cfba81a0b7cfc23bb7e68 (patch)
tree4f8cb9d97fa3118caf56276dd85c4bab7b1c9972 /net
parent7674575d8bdc06cb08d60eb30dddb57282bbbbf1 (diff)
downloadlinux-adc7f7c53219f8e0430cfba81a0b7cfc23bb7e68.tar.gz
linux-adc7f7c53219f8e0430cfba81a0b7cfc23bb7e68.tar.bz2
linux-adc7f7c53219f8e0430cfba81a0b7cfc23bb7e68.zip
tipc: increase timeout in tipc_sk_enqueue()
commit f4bb62e64c88c93060c051195d3bbba804e56945 upstream. In tipc_sk_enqueue() we use hardcoded 2 jiffies to extract socket buffer from generic queue to particular socket. The 2 jiffies is too short in case there are other high priority tasks get CPU cycles for multiple jiffies update. As result, no buffer could be enqueued to particular socket. To solve this, we switch to use constant timeout 20msecs. Then, the function will be expired between 2 jiffies (CONFIG_100HZ) and 20 jiffies (CONFIG_1000HZ). Fixes: c637c1035534 ("tipc: resolve race problem at unicast message reception") Acked-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 2e4d892768f9..94e74987fe65 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1775,7 +1775,7 @@ static int tipc_backlog_rcv(struct sock *sk, struct sk_buff *skb)
static void tipc_sk_enqueue(struct sk_buff_head *inputq, struct sock *sk,
u32 dport, struct sk_buff_head *xmitq)
{
- unsigned long time_limit = jiffies + 2;
+ unsigned long time_limit = jiffies + usecs_to_jiffies(20000);
struct sk_buff *skb;
unsigned int lim;
atomic_t *dcnt;