Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Bret Barkelew
, Michael D<mailto:michael.d.kin...@intel.com>; Sean Brogan<mailto:sean.bro...@microsoft.com> Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>; Gao, Liming<mailto:liming....@intel.com> Subject: Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance On

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Laszlo Ersek
On 02/13/18 18:51, Laszlo Ersek wrote: > So, my point is, we should be aware of what ISO C says about integer > overflow, and then pick one: > > - we target strict ISO C compliance (wrt. integer arithmetic) with > SafeIntLib -- in which case a re-evaluation and patches are necessary, > > - or else

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Laszlo Ersek
On 02/13/18 18:15, Andrew Fish wrote: > > >> On Feb 13, 2018, at 8:56 AM, Bret Barkelew >> mailto:bret.barke...@microsoft.com>> wrote: >> >> In response to the original question, I would content that our goal >> should be "a". We should be allowing universal detection of errors >> without the cal

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Ard Biesheuvel
ary, > > - or else we define additional C language guarantees, and then we > *ensure* those via compiler flags, universally. > > Thanks, > Laszlo > > >> >> >>>> -Original Message- >>>> From: edk2-devel [mailto:edk2-devel-boun..

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Laszlo Ersek
ia compiler flags, universally. Thanks, Laszlo > > >>> -Original Message- >>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] >>> On Behalf Of Laszlo Ersek >>> Sent: Tuesday, February 13, 2018 4:24 AM >>> To: Kinney, Mi

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Laszlo Ersek
On 02/13/18 17:56, Bret Barkelew wrote: > In response to the original question, I would content that our goal > should be "a". We should be allowing universal detection of errors > without the caller having to carry this detection code itself. OK. The question is how the detection is implemented

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Ard Biesheuvel
--Original Message- >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] >> On Behalf Of Laszlo Ersek >> Sent: Tuesday, February 13, 2018 4:24 AM >> To: Kinney, Michael D ; Sean >> Brogan >> Cc: edk2-devel@lists.01.org; Gao, Liming >>

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Andrew Fish
__ > From: Kinney, Michael D <mailto:michael.d.kin...@intel.com>> > Sent: Tuesday, February 13, 2018 8:17:48 AM > To: Laszlo Ersek; Sean Brogan; Bret Barkelew > Cc: edk2-devel@lists.01.org <mailto:edk2-devel@lists.01.org>; Gao, Liming > Subject: RE: [ed

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Bret Barkelew
Brogan; Bret Barkelew Cc: edk2-devel@lists.01.org; Gao, Liming Subject: RE: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance +Bret Mike > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] > On Behalf Of Laszlo Ersek > Sent: Tu

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Kinney, Michael D
: Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add > SafeIntLib class and instance > > Sean, Michael, > > can you please follow up on this? > > To clarify, I think this is a serious bug in SafeIntLib, > dependent on > what we want to use this library for. As far as I &g

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-13 Thread Laszlo Ersek
Sean, Michael, can you please follow up on this? To clarify, I think this is a serious bug in SafeIntLib, dependent on what we want to use this library for. As far as I understand, SafeIntLib intends to centralize integer manipulation / arithmetic, so that client code need not concern itself with

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-07 Thread Laszlo Ersek
On 02/08/18 01:32, Laszlo Ersek wrote: > On 12/19/17 20:36, Kinney, Michael D wrote: >> From: Sean Brogan >> >> SafeIntLib provides helper functions to prevent integer overflow >> during type conversion, addition, subtraction, and multiplication. > > I clearly cannot review such a huge patch, but

Re: [edk2] [Patch] MdePkg/BaseSafeIntLib: Add SafeIntLib class and instance

2018-02-07 Thread Laszlo Ersek
On 12/19/17 20:36, Kinney, Michael D wrote: > From: Sean Brogan > > SafeIntLib provides helper functions to prevent integer overflow > during type conversion, addition, subtraction, and multiplication. I clearly cannot review such a huge patch, but I've noticed something and would like to ask fo