On 03/20/2018 07:44 AM, David Lebrun wrote: > From: David Lebrun <dleb...@google.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 <dleb...@google.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()