]> git.baikalelectronics.ru Git - kernel.git/commit
net: tipc: Fix a sleep-in-atomic bug in tipc_msg_reverse
authorJia-Ju Bai <baijiaju1990@163.com>
Sat, 10 Jun 2017 09:03:35 +0000 (17:03 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Jun 2017 22:20:38 +0000 (18:20 -0400)
commit950098bea964ad67d738a122bfd2c0b629b5fb40
tree05088e941fe1061b7d12f351302be316949352c0
parente44f0813a642bc77ae4273bdde689014538fa7f9
net: tipc: Fix a sleep-in-atomic bug in tipc_msg_reverse

The kernel may sleep under a rcu read lock in tipc_msg_reverse, and the
function call path is:
tipc_l2_rcv_msg (acquire the lock by rcu_read_lock)
  tipc_rcv
    tipc_sk_rcv
      tipc_msg_reverse
        pskb_expand_head(GFP_KERNEL) --> may sleep
tipc_node_broadcast
  tipc_node_xmit_skb
    tipc_node_xmit
      tipc_sk_rcv
        tipc_msg_reverse
          pskb_expand_head(GFP_KERNEL) --> may sleep

To fix it, "GFP_KERNEL" is replaced with "GFP_ATOMIC".

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/msg.c