public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [RFC PATCH 0/1] MdeModulePkg/PiDxeS3BootScriptLib: Use SafeIntLib to avoid truncation
@ 2020-02-13 18:29 Philippe Mathieu-Daudé
  2020-02-13 18:29 ` [RFC PATCH 1/1] " Philippe Mathieu-Daudé
  0 siblings, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-13 18:29 UTC (permalink / raw)
  To: devel
  Cc: Philippe Mathieu-Daude, Jian J Wang, Hao A Wu, Eric Dong,
	Laszlo Ersek

Commit 322ac05f8bbc added truncation checks to fix CVE-2019-14563.

I found the 'a * b > d - c' reverse notation not obvious to review,
and suggested to write 'a * b + c > d'. Laszlo explained me this is
the EDK2 standard pattern to check against each overflow, but pointed
out the SafeIntLib which have pretty readable calls.

This is my try at using it.

Regards,

Phil.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>

Philippe Mathieu-Daudé (1):
  MdeModulePkg/PiDxeS3BootScriptLib: Use SafeIntLib to avoid truncation

 .../DxeS3BootScriptLib.inf                    |   1 +
 .../InternalBootScriptLib.h                   |   1 +
 .../PiDxeS3BootScriptLib/BootScriptSave.c     | 114 +++++++++++-------
 3 files changed, 73 insertions(+), 43 deletions(-)

-- 
2.21.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-02-18  7:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-13 18:29 [RFC PATCH 0/1] MdeModulePkg/PiDxeS3BootScriptLib: Use SafeIntLib to avoid truncation Philippe Mathieu-Daudé
2020-02-13 18:29 ` [RFC PATCH 1/1] " Philippe Mathieu-Daudé
2020-02-13 18:33   ` Philippe Mathieu-Daudé
2020-02-17  9:32     ` [edk2-devel] " Laszlo Ersek
2020-02-18  6:51       ` GuoMinJ
2020-02-18  7:04       ` GuoMinJ
2020-02-18  7:10       ` GuoMinJ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox