From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH] net: ipv6: route: Fix a sleep-in-atomic-context bug in ip6_convert_metrics() Date: Sat, 1 Sep 2018 22:25:55 -0600 Message-ID: <4cbf0c0c-ec8b-d953-8ff8-c5cab4d10441@gmail.com> References: <20180901111958.26529-1-baijiaju1990@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Jia-Ju Bai , davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org Return-path: In-Reply-To: <20180901111958.26529-1-baijiaju1990@gmail.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 9/1/18 5:19 AM, Jia-Ju Bai wrote: > The kernel module may sleep with holding a spinlock. ... > diff --git a/net/ipv6/route.c b/net/ipv6/route.c > index ec18b3ce8b6d..d15e72def7c1 100644 > --- a/net/ipv6/route.c > +++ b/net/ipv6/route.c > @@ -2742,7 +2742,7 @@ static int ip6_convert_metrics(struct net *net, struct fib6_info *rt, > if (!cfg->fc_mx) > return 0; > > - p = kzalloc(sizeof(*rt->fib6_metrics), GFP_KERNEL); > + p = kzalloc(sizeof(*rt->fib6_metrics), GFP_ATOMIC); > if (unlikely(!p)) > return -ENOMEM; > > This is the wrong solution. I'll take care of it next week after the holiday weekend.