lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 17 Mar 2018 13:21:51 +0300
From:   Kirill Tkhai <ktkhai@...tuozzo.com>
To:     kbuild test robot <lkp@...el.com>
Cc:     kbuild-all@...org, davem@...emloft.net, yoshfuji@...ux-ipv6.org,
        edumazet@...gle.com, yanhaishuang@...s.chinamobile.com,
        nikolay@...ulusnetworks.com, yotamg@...lanox.com,
        soheil@...gle.com, avagin@...tuozzo.com, nicolas.dichtel@...nd.com,
        ebiederm@...ssion.com, fw@...len.de, roman.kapl@...go.com,
        netdev@...r.kernel.org, xiyou.wangcong@...il.com,
        dvyukov@...gle.com, andreyknvl@...gle.com
Subject: Re: [PATCH net-next 4/5] net: Make ip_ra_chain per struct net

Hi,

On 17.03.2018 02:22, kbuild test robot wrote:
> 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)

thanks for reporting this! Forgot to add __rcu modifier to member type.
I'll send v2 version.

Kirill

> --
>>> 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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ