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] [thread-next>] [day] [month] [year] [list]
Message-ID: <79530b1e-aa32-682f-9735-8bc67098ac88@gmail.com>
Date:   Wed, 6 Feb 2019 11:08:18 -0800
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     David Ahern <dsahern@...il.com>,
        Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc:     Stefano Brivio <sbrivio@...hat.com>,
        David Miller <davem@...emloft.net>
Subject: Re: [PATCH net 1/2] geneve: should not call rt6_lookup() when ipv6
 was disabled



On 02/06/2019 10:54 AM, David Ahern wrote:
> On 2/6/19 4:51 AM, Hangbin Liu wrote:
>> When we add a new GENEVE device with IPv6 remote, checking only for
>> IS_ENABLED(CONFIG_IPV6) is not enough as we may disable IPv6 in kernel
>> cmd(ipv6.disable=1), which will cause a NULL pointer dereference.
>>
>> Reported-by: Jianlin Shi <jishi@...hat.com>
>> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
>> ---
>>  drivers/net/geneve.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
>> index 58bbba8582b0..0658715581e3 100644
>> --- a/drivers/net/geneve.c
>> +++ b/drivers/net/geneve.c
>> @@ -1512,6 +1512,10 @@ static void geneve_link_config(struct net_device *dev,
>>  	}
>>  #if IS_ENABLED(CONFIG_IPV6)
>>  	case AF_INET6: {
>> +		struct inet6_dev *idev = in6_dev_get(dev);
>> +		if (!idev)
>> +			break;
> 
> Since you don't need an idev reference rcu_access_pointer should be
> enough to say v6 is enabled on this device. ie., add a helper to check
> that rcu_access_pointer(dev->ip6_ptr) is non-NULL
> 

I guess RTNL is held at this point, so we can use a lockdep enabled
accessor : __in6_dev_get()

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ