From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 117411A1EC3 for ; Thu, 13 Oct 2016 18:36:16 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 13 Oct 2016 18:36:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,491,1473145200"; d="scan'208";a="772417081" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 13 Oct 2016 18:36:15 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 13 Oct 2016 18:36:15 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 13 Oct 2016 18:36:15 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.209]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.2]) with mapi id 14.03.0248.002; Fri, 14 Oct 2016 09:36:13 +0800 From: "Ni, Ruiyu" To: "Dong, Eric" , "edk2-devel@lists.01.org" , "Kinney, Michael D" , "Gao, Liming" Thread-Topic: [edk2] [Patch 0/2] MdePkg DevicePathLib: Check buffer length before use. Thread-Index: AQHSJIW+mJtBivfYuUGaXtW1qqyzUqCnLQKg Date: Fri, 14 Oct 2016 01:36:13 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D58E343F3@SHSMSX104.ccr.corp.intel.com> References: <1476275967-10888-1-git-send-email-eric.dong@intel.com> In-Reply-To: <1476275967-10888-1-git-send-email-eric.dong@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWEzMTdiZGEtN2I0NC00NTQ5LWIwNTItMjA2N2FiMzRlOThmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS45LjYuNiIsIlRydXN0ZWRMYWJlbEhhc2giOiJsRlIraVpcL1F0VzZPMzNSVFE3UkhweVl1MHVnRThNbTFkT1NIcnlUWlduVT0ifQ== x-ctpclassification: CTP_PUBLIC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch 0/2] MdePkg DevicePathLib: Check buffer length before use. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 01:36:16 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Please remove the ending back-slash in following lines. They are not needed= . + while (MaxSize >=3D sizeof (EFI_DEVICE_PATH_PROTOCOL) && \ + (MaxSize - sizeof (EFI_DEVICE_PATH_PROTOCOL) >=3D Size) && \ + !IsDevicePathEnd (DevicePath)) { With the above changes, Reviewed-by: Ruiyu Ni >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Eri= c Dong >Sent: Wednesday, October 12, 2016 8:39 PM >To: edk2-devel@lists.01.org; Kinney, Michael D ; Gao, Liming >Subject: [edk2] [Patch 0/2] MdePkg DevicePathLib: Check buffer length befo= re use. > >In IsDevicePathValid API, code should validate the device path >buffer not exceed the input MaxSize before reference the path >info. This patched series add this check. > >Eric Dong (2): > MdePkg UefiDevicePathLib: Validate buffer length before use buffer. > MdePkg UefiDevicePathLibDevicePathProtocol: Validate before use. > > .../UefiDevicePathLib/DevicePathUtilities.c | 25 ++++++++++++++++-= ----- > .../UefiDevicePathLib.c | 24 +++++++++++++++--= ---- > 2 files changed, 35 insertions(+), 14 deletions(-) > >-- >2.6.4.windows.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel