From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: hao.a.wu@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Tue, 24 Sep 2019 19:05:30 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 19:05:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,546,1559545200"; d="scan'208";a="191201058" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 24 Sep 2019 19:05:28 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 24 Sep 2019 19:05:28 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 24 Sep 2019 19:05:28 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.53]) with mapi id 14.03.0439.000; Wed, 25 Sep 2019 10:05:25 +0800 From: "Wu, Hao A" To: "Bi, Dandan" , "devel@edk2.groups.io" CC: Leif Lindholm , Ard Biesheuvel , "Wang, Jian J" , "Ni, Ray" , "Gao, Liming" , "Gao, Zhichao" , Laszlo Ersek , "Philippe Mathieu-Daude" Subject: Re: [edk2-devel] [patch v3 0/5] Unload image on EFI_SECURITY_VIOLATION Thread-Topic: [edk2-devel] [patch v3 0/5] Unload image on EFI_SECURITY_VIOLATION Thread-Index: AQHVctp0VXiXJuAeu0KmEKWfjdjsOac7olxAgAADMpA= Date: Wed, 25 Sep 2019 02:05:26 +0000 Message-ID: References: <15C762418138FF70.23104@groups.io> <3C0D5C461C9E904E8F62152F6274C0BB40C5F796@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <3C0D5C461C9E904E8F62152F6274C0BB40C5F796@SHSMSX104.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Bi, Dandan > Sent: Wednesday, September 25, 2019 9:56 AM > To: devel@edk2.groups.io; Wu, Hao A > Cc: Leif Lindholm; Ard Biesheuvel; Wang, Jian J; Ni, Ray; Gao, Liming; G= ao, > Zhichao; Laszlo Ersek; Philippe Mathieu-Daude; Bi, Dandan > Subject: RE: [edk2-devel] [patch v3 0/5] Unload image on > EFI_SECURITY_VIOLATION >=20 > Hi Hao, >=20 > Could you help to push this V3 patch series? The series has been pushed via commits 590c9d5828..c671c9106c. Best Regards, Hao Wu >=20 >=20 > Thanks, > Dandan > > -----Original Message----- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > > Dandan Bi > > Sent: Tuesday, September 24, 2019 9:17 PM > > To: devel@edk2.groups.io > > Cc: Leif Lindholm ; Ard Biesheuvel > > ; Wang, Jian J ; Wu, > > Hao A ; Ni, Ray ; Gao, Liming > > ; Gao, Zhichao ; Laszlo > > Ersek ; Philippe Mathieu-Daude > > > Subject: [edk2-devel] [patch v3 0/5] Unload image on > > EFI_SECURITY_VIOLATION > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1992 > > > > v2: > > Just enahnce the code error handling logic in patch 3. > > Other patches are the same and pick up the Acked-by and Reviewed-by in > > other patches. > > > > v2: > > (1) Just separate the patch in MdeModulePkg into module level, the > changes > > in EmbeddedPkg and ShellPkg are the same with V1. > > (2) Drop the update in PciBusDxe module in MdeModulePkg since with > > EFI_SECURITY_VIOLATION returned, the image may be used later. > > > > > > For the LoadImage() boot service, with EFI_SECURITY_VIOLATION retval, > the > > Image was loaded and an ImageHandle was created with a valid > > EFI_LOADED_IMAGE_PROTOCOL, but the image can not be started right > now. > > This follows UEFI Spec. > > > > But if the caller of LoadImage() doesn't have the option to defer the > > execution of an image, we can not treat EFI_SECURITY_VIOLATION like an= y > > other LoadImage() error, we should unload image for the > > EFI_SECURITY_VIOLATION to avoid resource leak. > > > > This patch is to do error handling for EFI_SECURITY_VIOLATION explicit= ly > for > > the callers in edk2 which don't have the policy to defer the execution= of > the > > image. > > > > Cc: Leif Lindholm > > Cc: Ard Biesheuvel > > Cc: Jian J Wang > > Cc: Hao A Wu > > Cc: Ray Ni > > Cc: Liming Gao > > Cc: Zhichao Gao > > Cc: Laszlo Ersek > > Cc: Philippe Mathieu-Daude Dandan Bi (3): > > EmbeddedPkg: Unload image on EFI_SECURITY_VIOLATION > > MdeModulePkg/DxeCapsuleLibFmp: Unload image on > > EFI_SECURITY_VIOLATION > > MdeModulePkg/UefiBootManager: Unload image on > > EFI_SECURITY_VIOLATION > > MdeModulePkg/PlatformDriOverride: Unload image on > > EFI_SECURITY_VIOLATION > > ShellPkg: Unload image on EFI_SECURITY_VIOLATION > > > > .../AndroidFastboot/Arm/BootAndroidBootImg.c | 9 +++++++++ > > .../Library/AndroidBootImgLib/AndroidBootImgLib.c | 12 +++++++++++= + > > .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 9 +++++++++ > > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 9 +++++++++ > > .../Library/UefiBootManagerLib/BmLoadOption.c | 14 +++++++++++= +-- > > MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c | 14 > > ++++++++++++-- > > .../PlatformDriOverrideDxe/PlatDriOverrideLib.c | 11 ++++++++++- > > ShellPkg/Application/Shell/ShellManParser.c | 9 +++++++++ > > .../Library/UefiShellDebug1CommandsLib/LoadPciRom.c | 11 ++++++++++- > > ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c | 11 ++++++++++- > > 10 files changed, 98 insertions(+), 5 deletions(-) > > > > -- > > 2.18.0.windows.1 > > > > > >=20