From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 A07F121179244 for ; Mon, 15 Oct 2018 20:31:32 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Oct 2018 20:31:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,387,1534834800"; d="scan'208";a="100557053" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.11]) ([10.239.9.11]) by orsmga002.jf.intel.com with ESMTP; 15 Oct 2018 20:31:29 -0700 To: "Zeng, Star" , edk2-devel@lists.01.org References: <20181015063833.61304-1-ruiyu.ni@intel.com> <20181015063833.61304-3-ruiyu.ni@intel.com> <63407d7d-cf64-e652-a77b-63ddd6758937@intel.com> From: "Ni, Ruiyu" Message-ID: <75b0e1c6-5d6c-b27e-96ea-251cd26d8cd5@Intel.com> Date: Tue, 16 Oct 2018 11:32:39 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <63407d7d-cf64-e652-a77b-63ddd6758937@intel.com> Subject: Re: [PATCH 02/11] MdeModulePkg/UsbMass: Fix integer overflow when BlockSize is 1 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2018 03:31:32 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/16/2018 11:19 AM, Zeng, Star wrote: > On 2018/10/15 14:38, Ruiyu Ni wrote: >> UsbBootReadWriteBlocks() and UsbBootReadWriteBlocks16() use a UINT16 >> local variable to hold the value of >> USB_BOOT_MAX_CARRY_SIZE (=0x10000) / BlockSize. >> When BlockSize is 1, the UINT16 local variable is set to 0x10000 > > Ray, > > Thanks for the patch. > Is it possible that the BlockSize == 0 or > USB_BOOT_MAX_CARRY_SIZE? With a buggy HW, everything is possible:( I will re-post V2 patch to handle this case. > > > Thanks, > Star > > > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel -- Thanks, Ray