Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751820AbdFJWVp (ORCPT ); Sat, 10 Jun 2017 18:21:45 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:36736 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751712AbdFJWVn (ORCPT ); Sat, 10 Jun 2017 18:21:43 -0400 Date: Sat, 10 Jun 2017 18:21:41 -0400 (EDT) Message-Id: <20170610.182141.2167495708271774980.davem@davemloft.net> To: baijiaju1990@163.com Cc: jon.maloy@ericsson.com, ying.xue@windriver.com, netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: tipc: Fix a sleep-in-atomic bug in tipc_msg_reverse From: David Miller In-Reply-To: <1497085415-630-1-git-send-email-baijiaju1990@163.com> References: <1497085415-630-1-git-send-email-baijiaju1990@163.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 10 Jun 2017 14:40:02 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 659 Lines: 22 From: Jia-Ju Bai Date: Sat, 10 Jun 2017 17:03:35 +0800 > 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 Applied and queued up for -stable.