Hi Kirill, Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on v4.16-rc4] [also build test WARNING on next-20180316] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Kirill-Tkhai/Rework-ip_ra_chain-protection/20180317-032841 reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) >> net/ipv4/ip_input.c:162:19: sparse: incompatible types in comparison >> expression (different address spaces) -- >> net/ipv4/ip_sockglue.c:347:18: sparse: incorrect type in assignment >> (different address spaces) @@ expected struct ip_ra_chain [noderef] >> <asn:4>**rap @@ got n [noderef] <asn:4>**rap @@ net/ipv4/ip_sockglue.c:347:18: expected struct ip_ra_chain [noderef] <asn:4>**rap net/ipv4/ip_sockglue.c:347:18: got struct ip_ra_chain **<noident> vim +162 net/ipv4/ip_input.c 150 151 /* 152 * Process Router Attention IP option (RFC 2113) 153 */ 154 bool ip_call_ra_chain(struct sk_buff *skb) 155 { 156 struct ip_ra_chain *ra; 157 u8 protocol = ip_hdr(skb)->protocol; 158 struct sock *last = NULL; 159 struct net_device *dev = skb->dev; 160 struct net *net = dev_net(dev); 161 > 162 for (ra = rcu_dereference(net->ipv4.ra_chain); ra; ra = > rcu_dereference(ra->next)) { 163 struct sock *sk = ra->sk; 164 165 /* If socket is bound to an interface, only report 166 * the packet if it came from that interface. 167 */ 168 if (sk && inet_sk(sk)->inet_num == protocol && 169 (!sk->sk_bound_dev_if || 170 sk->sk_bound_dev_if == dev->ifindex)) { 171 if (ip_is_fragment(ip_hdr(skb))) { 172 if (ip_defrag(net, skb, IP_DEFRAG_CALL_RA_CHAIN)) 173 return true; 174 } 175 if (last) { 176 struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); 177 if (skb2) 178 raw_rcv(last, skb2); 179 } 180 last = sk; 181 } 182 } 183 184 if (last) { 185 raw_rcv(last, skb); 186 return true; 187 } 188 return false; 189 } 190 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation