• E
    ipv6: exthdrs: do not blindly use init_net · d87b27cd
    Eric Dumazet 提交于
    stable inclusion
    from linux-4.19.198
    commit d317a20a84c434ae0a2011e551e6f400b995c32e
    
    --------------------------------
    
    [ Upstream commit bcc3f2a8 ]
    
    I see no reason why max_dst_opts_cnt and max_hbh_opts_cnt
    are fetched from the initial net namespace.
    
    The other sysctls (max_dst_opts_len & max_hbh_opts_len)
    are in fact already using the current ns.
    
    Note: it is not clear why ipv6_destopt_rcv() use two ways to
    get to the netns :
    
     1) dev_net(dst->dev)
        Originally used to increment IPSTATS_MIB_INHDRERRORS
    
     2) dev_net(skb->dev)
         Tom used this variant in his patch.
    
    Maybe this calls to use ipv6_skb_net() instead ?
    
    Fixes: 47d3d7ac ("ipv6: Implement limits on Hop-by-Hop and Destination options")
    Signed-off-by: NEric Dumazet <edumazet@google.com>
    Cc: Tom Herbert <tom@quantonium.net>
    Cc: Coco Li <lixiaoyan@google.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    Signed-off-by: NSasha Levin <sashal@kernel.org>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    d87b27cd
exthdrs.c 27.2 KB