From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.7815.1676384167151641662 for ; Tue, 14 Feb 2023 06:16:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=T249fE5Q; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [192.168.4.22] (unknown [47.201.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id 5EA1220E2C3E; Tue, 14 Feb 2023 06:16:05 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5EA1220E2C3E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1676384166; bh=v9Mm39jhw1dntODpBXoAcLoiOxAADlSdqVJN46AQcTQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=T249fE5QY+jlvDMuaRnlNjaAe4B+Zk+UBSFlBSeBKbMy2y+kci+NIC49kwVo9Wkgy 0+JurGDgvZFSTKohSnGm7sJH4ChV2syLCe/MV2FP3any7tdk2n4Psw8rMrqM393yLq fYk4g03Se3awkyVnbXBy91cwMDjIKBvctcg9IerQ= Message-ID: Date: Tue, 14 Feb 2023 09:16:04 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [edk2-devel] [PATCH v3 01/12] MdeModulePkg/SmbiosDxe: Fix pointer and buffer overflow CodeQL alerts To: devel@edk2.groups.io, kraxel@redhat.com, Michael Brown Cc: Dandan Bi , Erich McMillan , Jian J Wang , Liming Gao , Star Zeng , Zhichao Gao , Zhiguang Liu , Michael Kubacki References: <20230213154908.1993-1-mikuback@linux.microsoft.com> <20230213154908.1993-2-mikuback@linux.microsoft.com> <010201864b8f56cb-c9b052f6-c9e6-4c22-9d99-c87c947a7169-000000@eu-west-1.amazonses.com> <20230214130114.kp4z4zmfjgaalv47@sirius.home.kraxel.org> <01020186502e636e-e8e67b6b-f07a-43b9-aa39-35be69d08c68-000000@eu-west-1.amazonses.com> <20230214141147.saswcivljvjuhdxa@sirius.home.kraxel.org> From: "Michael Kubacki" In-Reply-To: <20230214141147.saswcivljvjuhdxa@sirius.home.kraxel.org> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit I know the second case was missed, that will be updated. I agree calculating the remaining buffer space is more straightforward here without the library so I'll go with that approach in a v4 of the series. Thanks for the detailed feedback. On 2/14/2023 9:11 AM, Gerd Hoffmann wrote: > Hi, > >> [ ... details snipped ... ] >> >> I'd prefer it if the code were updated to avoid SafeUintnAdd() altogether. >> But if not, then at a minimum the redundant check should be removed, and the >> calculation involving Smbios.Hdr->Length should also be updated to use >> SafeUintnAdd(). > > Fully agreeing to that. > > take care, > Gerd > > > > >