From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 6CECEAC11BF for ; Mon, 6 Nov 2023 07:53:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=FeoraufIZoGpGfDda30B68wgZJNhU705r/8f0dXglAw=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1699257185; v=1; b=nkL6EpSeWckMG4f7EKDSCUmI3/43Tf/9TkarC5ihZ/7rZNOkL/R+9FHQQGaxoKuD3PfYoJ3T kFMGOdgdU+NxhRblTiEasBPDulYtifI59bRg2ESY2Y+O0jqlYE9tb0jXccbeeTSJb2jvwp8Y2St CsOadTHL2/KvAvBZln3bvbe4= X-Received: by 127.0.0.2 with SMTP id svGUYY7687511xCXq52vUCfU; Sun, 05 Nov 2023 23:53:05 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.49168.1699257184993246575 for ; Sun, 05 Nov 2023 23:53:05 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="453535761" X-IronPort-AV: E=Sophos;i="6.03,280,1694761200"; d="scan'208";a="453535761" X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2023 23:53:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="885824581" X-IronPort-AV: E=Sophos;i="6.03,280,1694761200"; d="scan'208";a="885824581" X-Received: from shpfwdbuild003.ccr.corp.intel.com ([10.239.56.82]) by orsmga004.jf.intel.com with ESMTP; 05 Nov 2023 23:53:02 -0800 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Wei6 Xu , Laszlo Ersek , Ard Biesheuvel , Sami Mujawar , Ray Ni Subject: [edk2-devel] [PATCH v4 0/4] StandaloneMmCore finds drivers in uncompressed inner fv. Date: Mon, 6 Nov 2023 15:52:55 +0800 Message-Id: MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wei6.xu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: I48nITnqTBUCYxohYHDr43QVx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=nkL6EpSe; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io V1: This patch is to fix the issue that StandaloneMmCore fails to detect uncompressed inner FV. PR: https://github.com/tianocore/edk2/pull/4943 V2: Based on V1, fix some other issues 1. Add Missing object size checks before casting pointers to header types a. InnerFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)SectionData; This is introduced in V1, add the size check on SectionDataSize against EFI_FIRMWARE_VOLUME_HEADER b. Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1); Use FfsFindSection instead of FfsFindSectionData to avoid pointer casting. 2. Fix potential memory leak issue that ScratchBuffer is not freed when page allocation for DstBuffer fails. PR: https://github.com/tianocore/edk2/pull/4965 V3: 1. Separate patch per individual issue fix on patch V2. 2. Fix one more issue: Limit FwVol encapsulation section recursion in MmCoreFfsFindMmDriver(). PR: https://github.com/tianocore/edk2/pull/4975 V4: Patch (1/4): Move the declaration of MmCoreFfsFindMmDriver() from source file to the header file "StandaloneMmCore.h" Patch (2/4): Handle the case that ExtractGuidedSectionDecode()'s decoded buffer is identical to the data in InputSection Patch (3/4): Fix the issue 'Section + 1' migth be a wrong address for InnerFvHeader if Section is EFI_COMMON_SECTION_HEADER2. Patch (4/4): 'Continue' if an EFI_SECTION_FIRMWARE_VOLUME_IMAGE is found, do not look for an EFI_SECTION_GUID_DEFINED again. PR: https://github.com/tianocore/edk2/pull/5004 For the recursion logic improvement, Let's do it in other patch set in future after this patch is committed. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Ray Ni Wei6 Xu (4): StandaloneMmPkg/Core: Limit FwVol encapsulation section recursion StandaloneMmPkg/Core: Fix potential memory leak issue StandaloneMmPkg/Core: Fix issue that offset calculation might be wrong StandaloneMmPkg/Core: Fix the failure to find uncompressed inner FV StandaloneMmPkg/Core/Dispatcher.c | 5 -- StandaloneMmPkg/Core/FwVol.c | 88 +++++++++++++++++------ StandaloneMmPkg/Core/StandaloneMmCore.c | 7 +- StandaloneMmPkg/Core/StandaloneMmCore.h | 26 +++++++ StandaloneMmPkg/Core/StandaloneMmCore.inf | 3 + StandaloneMmPkg/StandaloneMmPkg.dec | 5 ++ 6 files changed, 103 insertions(+), 31 deletions(-) -- 2.29.2.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110736): https://edk2.groups.io/g/devel/message/110736 Mute This Topic: https://groups.io/mt/102415997/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-