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: Wed, 24 May 2023 08:46:30 -0700
From: Tony Nguyen <anthony.l.nguyen@...el.com>
To: Alexander Lobakin <aleksander.lobakin@...el.com>, Jakub Kicinski
	<kuba@...nel.org>, Kees Cook <keescook@...omium.org>
CC: "Darrick J. Wong" <djwong@...nel.org>, Daniel Latypov
	<dlatypov@...gle.com>, <storagedev@...rochip.com>,
	<linux-nvme@...ts.infradead.org>, James Smart <james.smart@...adcom.com>,
	"Guo Xuenan" <guoxuenan@...wei.com>, Eric Dumazet <edumazet@...gle.com>,
	<linux-hardening@...r.kernel.org>, Christoph Hellwig <hch@....de>, "Sagi
 Grimberg" <sagi@...mberg.me>, <linux-scsi@...r.kernel.org>, Jesse Brandeburg
	<jesse.brandeburg@...el.com>, Kashyap Desai <kashyap.desai@...adcom.com>,
	Christoph Hellwig <hch@...radead.org>, <intel-wired-lan@...ts.osuosl.org>,
	Paolo Abeni <pabeni@...hat.com>, "James E.J. Bottomley" <jejb@...ux.ibm.com>,
	Gwan-gyeong Mun <gwan-gyeong.mun@...el.com>, Dave Chinner
	<dchinner@...hat.com>, Keith Busch <kbusch@...nel.org>, HighPoint Linux Team
	<linux@...hpoint-tech.com>, <megaraidlinux.pdl@...adcom.com>, Jens Axboe
	<axboe@...nel.dk>, "Martin K. Petersen" <martin.petersen@...cle.com>,
	Shivasharan S <shivasharan.srikanteshwara@...adcom.com>,
	<netdev@...r.kernel.org>, Nick Desaulniers <ndesaulniers@...gle.com>,
	<linux-kernel@...r.kernel.org>, <linux-xfs@...r.kernel.org>, Sumit Saxena
	<sumit.saxena@...adcom.com>, Tales Aparecida <tales.aparecida@...il.com>,
	"Don Brace" <don.brace@...rochip.com>, "David S. Miller"
	<davem@...emloft.net>
Subject: Re: [Intel-wired-lan] [PATCH] overflow: Add struct_size_t() helper

On 5/24/2023 7:17 AM, Alexander Lobakin wrote:
> From: Jakub Kicinski <kuba@...nel.org>
> Date: Tue, 23 May 2023 20:53:54 -0700
> 
>> On Mon, 22 May 2023 14:18:13 -0700 Kees Cook wrote:
>>> diff --git a/drivers/net/ethernet/intel/ice/ice_ddp.h b/drivers/net/ethernet/intel/ice/ice_ddp.h
>>> index 37eadb3d27a8..41acfe26df1c 100644
>>> --- a/drivers/net/ethernet/intel/ice/ice_ddp.h
>>> +++ b/drivers/net/ethernet/intel/ice/ice_ddp.h
>>> @@ -185,7 +185,7 @@ struct ice_buf_hdr {
>>>   
>>>   #define ICE_MAX_ENTRIES_IN_BUF(hd_sz, ent_sz)                                 \
>>>   	((ICE_PKG_BUF_SIZE -                                                  \
>>> -	  struct_size((struct ice_buf_hdr *)0, section_entry, 1) - (hd_sz)) / \
>>> +	  struct_size_t(struct ice_buf_hdr,  section_entry, 1) - (hd_sz)) / \
>>>   	 (ent_sz))
>>>   
>>>   /* ice package section IDs */
>>> @@ -297,7 +297,7 @@ struct ice_label_section {
>>>   };
>>>   
>>>   #define ICE_MAX_LABELS_IN_BUF                                             \
>>> -	ICE_MAX_ENTRIES_IN_BUF(struct_size((struct ice_label_section *)0, \
>>> +	ICE_MAX_ENTRIES_IN_BUF(struct_size_t(struct ice_label_section,  \
>>>   					   label, 1) -                    \
>>>   				       sizeof(struct ice_label),          \
>>>   			       sizeof(struct ice_label))
>>> @@ -352,7 +352,7 @@ struct ice_boost_tcam_section {
>>>   };
>>>   
>>>   #define ICE_MAX_BST_TCAMS_IN_BUF                                               \
>>> -	ICE_MAX_ENTRIES_IN_BUF(struct_size((struct ice_boost_tcam_section *)0, \
>>> +	ICE_MAX_ENTRIES_IN_BUF(struct_size_t(struct ice_boost_tcam_section,  \
>>>   					   tcam, 1) -                          \
>>>   				       sizeof(struct ice_boost_tcam_entry),    \
>>>   			       sizeof(struct ice_boost_tcam_entry))
>>> @@ -372,8 +372,7 @@ struct ice_marker_ptype_tcam_section {
>>>   };
>>>   
>>>   #define ICE_MAX_MARKER_PTYPE_TCAMS_IN_BUF                                    \
>>> -	ICE_MAX_ENTRIES_IN_BUF(                                              \
>>> -		struct_size((struct ice_marker_ptype_tcam_section *)0, tcam, \
>>> +	ICE_MAX_ENTRIES_IN_BUF(struct_size_t(struct ice_marker_ptype_tcam_section,  tcam, \
>>>   			    1) -                                             \
>>>   			sizeof(struct ice_marker_ptype_tcam_entry),          \
>>>   		sizeof(struct ice_marker_ptype_tcam_entry))
>>
>> Acked-by: Jakub Kicinski <kuba@...nel.org>
>>
>> but Intel ICE folks please speak up if this has a high chance of
>> conflicts, I think I've seen some ICE DDP patches flying around :(
> 
> I haven't found anything that would conflict with this, esp. since it
> implies no functional changes.

Same here. I'm not seeing any conflicts with the patches I'm aware of.

Thanks,
Tony

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ