[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <be3808c5-e860-c4b8-b87a-3d9582b03795@gmail.com>
Date: Tue, 20 Mar 2018 08:07:11 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Lebrun <dav.lebrun@...il.com>, netdev@...r.kernel.org
Cc: David Lebrun <dlebrun@...gle.com>
Subject: Re: [PATCH net] ipv6: sr: fix scheduling in RCU when creating seg6
lwtunnel state
On 03/20/2018 07:44 AM, David Lebrun wrote:
> From: David Lebrun <dlebrun@...gle.com>
>
> The seg6_build_state() function is called with RCU read lock held,
> so we cannot use GFP_KERNEL. This patch uses GFP_ATOMIC instead.
>
>
> Fixes: 6c8702c60b886 ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels")
> Signed-off-by: David Lebrun <dlebrun@...gle.com>
> ---
> net/ipv6/seg6_iptunnel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c
> index bd6cc688bd19..8367b859a934 100644
> --- a/net/ipv6/seg6_iptunnel.c
> +++ b/net/ipv6/seg6_iptunnel.c
> @@ -418,7 +418,7 @@ static int seg6_build_state(struct nlattr *nla,
>
> slwt = seg6_lwt_lwtunnel(newts);
>
> - err = dst_cache_init(&slwt->cache, GFP_KERNEL);
> + err = dst_cache_init(&slwt->cache, GFP_ATOMIC);
>
This is not the proper fix.
Control path holds RTNL and can sleeep if needed.
RCU should be avoided in lwtunnel_build_state()
Powered by blists - more mailing lists