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]
Date: Tue, 19 Dec 2023 15:04:59 +0100
From: "Plachno, Lukasz" <lukasz.plachno@...el.com>
To: Simon Horman <horms@...nel.org>
CC: <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>, "Jakub
 Buchocki" <jakubx.buchocki@...el.com>, Mateusz Pacuszka
	<mateuszx.pacuszka@...el.com>, Przemek Kitszel <przemyslaw.kitszel@...el.com>
Subject: Re: [PATCH iwl-next v3 2/2] ice: Implement 'flow-type ether' rules

On 12/16/2023 11:03 AM, Simon Horman wrote:
> On Thu, Dec 14, 2023 at 05:34:49AM +0100, Lukasz Plachno wrote:
> 
> ...
> 
>> @@ -1199,6 +1212,99 @@ ice_set_fdir_ip6_usr_seg(struct ice_flow_seg_info *seg,
>>   	return 0;
>>   }
>>   
>> +/**
>> + * ice_fdir_vlan_valid - validate VLAN data for Flow Director rule
>> + * @fsp: pointer to ethtool Rx flow specification
>> + *
>> + * Return: true if vlan data is valid, false otherwise
>> + */
>> +static bool ice_fdir_vlan_valid(struct ethtool_rx_flow_spec *fsp)
>> +{
>> +	if (fsp->m_ext.vlan_etype &&
>> +	    ntohs(fsp->h_ext.vlan_etype) & ~(ETH_P_8021Q | ETH_P_8021AD))
>> +		return false;
> 
> Hi Jakub and Lukasz,
> 
> It is not obvious to me that a bitwise comparison of the vlan_ethtype is
> correct. Possibly naively I expected something more like
> (completely untested!):
> 
> 	if (!eth_type_vlan(sp->m_ext.vlan_etype))
> 		return false:
> 
>> +
>> +	if (fsp->m_ext.vlan_tci &&
>> +	    ntohs(fsp->h_ext.vlan_tci) >= VLAN_N_VID)
>> +		return false;
>> +
>> +	return true;
>> +}

eth_type_vlan() does what is needed here and is much more readable, I 
will switch to it in V4

Thanks,
Ɓukasz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ