lkml.org 
[lkml]   [2018]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net: ipv6: route: Fix a sleep-in-atomic-context bug in ip6_convert_metrics()
From
Date
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.

\
 
 \ /
  Last update: 2018-09-02 06:27    [W:0.056 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site