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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ecd693a5-105b-d2b8-5f6d-618d14b491dd@huawei.com>
Date: Tue, 5 Sep 2023 19:43:18 +0800
From: "Ziyang Xuan (William)" <william.xuanziyang@...wei.com>
To: Hangbin Liu <liuhangbin@...il.com>
CC: <jiri@...nulli.us>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net v2] team: fix null-ptr-deref when team device type is
 changed

> On Tue, Sep 05, 2023 at 03:46:38PM +0800, Ziyang Xuan wrote:
>> diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>> index d3dc22509ea5..12fb5f4cff06 100644
>> --- a/drivers/net/team/team.c
>> +++ b/drivers/net/team/team.c
>> @@ -2127,7 +2127,10 @@ static const struct ethtool_ops team_ethtool_ops = {
>>  static void team_setup_by_port(struct net_device *dev,
>>  			       struct net_device *port_dev)
>>  {
>> -	dev->header_ops	= port_dev->header_ops;
>> +	if (port_dev->type == ARPHRD_ETHER)
>> +		dev->header_ops	= &eth_header_ops;
>> +	else
>> +		dev->header_ops	= port_dev->header_ops;
>>  	dev->type = port_dev->type;
>>  	dev->hard_header_len = port_dev->hard_header_len;
>>  	dev->needed_headroom = port_dev->needed_headroom;
> 
> Hmm.. Do we need to export eth_header_ops? I got error like
> ERROR: modpost: "eth_header_ops" [drivers/net/team/team.ko] undefined!
> 
> But I saw function loopback_setup() could reference this. Not sure what
> I missed here.

Yes, I also got the same error, and gave v3 patch with exporting eth_header_ops.

drivers/net/loopback.o controlled by CONFIG_NET, CONFIG_NET is bool type and usually Y.
So drivers/net/loopback.o does not need to export eth_header_ops.

> 
> Thanks
> Hangbin
> 
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ