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: <2be7caf2-33ea-4e38-bb84-0886220cfc48@openvpn.net>
Date: Wed, 17 Jul 2024 16:07:37 +0200
From: Antonio Quartulli <antonio@...nvpn.net>
To: Sabrina Dubroca <sd@...asysnail.net>
Cc: netdev@...r.kernel.org, kuba@...nel.org, ryazanov.s.a@...il.com,
 pabeni@...hat.com, edumazet@...gle.com, andrew@...n.ch
Subject: Re: [PATCH net-next v5 16/25] ovpn: implement peer lookup logic

Hi,

On 15/07/2024 15:11, Sabrina Dubroca wrote:
> 2024-06-27, 15:08:34 +0200, Antonio Quartulli wrote:
>>   /**
>>    * ovpn_peer_check_by_src - check that skb source is routed via peer
>>    * @ovpn: the openvpn instance to search
>>    * @skb: the packet to extra source address from
> 
> nit, just noticed now but should be fixed in patch 12: s/to extra/to extract/

argh. thanks!

> 
> [...]
>> @@ -324,11 +576,11 @@ static int ovpn_peer_add_mp(struct ovpn_struct *ovpn, struct ovpn_peer *peer)
>>   	struct sockaddr_storage sa = { 0 };
>>   	struct sockaddr_in6 *sa6;
>>   	struct sockaddr_in *sa4;
>> +	struct hlist_head *head;
>>   	struct ovpn_bind *bind;
>>   	struct ovpn_peer *tmp;
>>   	size_t salen;
>>   	int ret = 0;
>> -	u32 index;
>>   
>>   	spin_lock_bh(&ovpn->peers->lock);
>>   	/* do not add duplicates */
>> @@ -364,30 +616,27 @@ static int ovpn_peer_add_mp(struct ovpn_struct *ovpn, struct ovpn_peer *peer)
>>   			goto unlock;
>>   		}
>>   
>> -		index = ovpn_peer_index(ovpn->peers->by_transp_addr, &sa,
>> -					salen);
>> -		hlist_add_head_rcu(&peer->hash_entry_transp_addr,
>> -				   &ovpn->peers->by_transp_addr[index]);
>> +		head = ovpn_get_hash_head(ovpn->peers->by_transp_addr, &sa,
>> +					  salen);
>> +		hlist_add_head_rcu(&peer->hash_entry_transp_addr, head);
>>   	}
> 
> These changes to ovpn_peer_add_mp (and the replacement of
> ovpn_peer_index with ovpn_get_hash_head) could be squashed into the
> previous patch.

hmm true. will do.


Thanks!


> 

-- 
Antonio Quartulli
OpenVPN Inc.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ