From nobody Wed May 1 14:03:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91647+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91647+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658424091; cv=none; d=zohomail.com; s=zohoarc; b=TmCFtpFjHQY0fSBvhf4c00ht9AmzRq6fc3M16RwgQNdKQSbNDA0XEveA8w6hY/BmqJ3kzPaqetPPxwydVgiNTE3Kw74oMUqbbGskfIRPnSTpaTgA26tsKuH2ey5X5qCzx31oydkLtX0jFJ7HI1JVQuRCqxtBQLsslVUqUWFO50M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658424091; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=X3tfx9c2VcDW9iRIHWKf04vbLS3xCQdD710VuZIp32o=; b=VIgWFVGxpeLRmLww1zPKv/tX1PflUstqBdEYMQEkF7QNRCCcpeOqr/UKoKEZuHFQjOf1nxsgN9Q+Zx9663wdm+Rgl2eQcX8GrgNiu+sH/+WoExl/9Wir22MVUd0OQySHR3KxU/EfIs0FOg0qbKGGFDIC+ixK7r6l/wlMbqakXgI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91647+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1658424091033529.2043165037591; Thu, 21 Jul 2022 10:21:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id hmuXYY1788612xMJBq9FuX7e; Thu, 21 Jul 2022 10:21:29 -0700 X-Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by mx.groups.io with SMTP id smtpd.web12.39753.1658232635155523363 for ; Tue, 19 Jul 2022 05:10:35 -0700 X-Received: by mail-lf1-f54.google.com with SMTP id e28so24373565lfj.4 for ; Tue, 19 Jul 2022 05:10:34 -0700 (PDT) X-Gm-Message-State: zODKQdVvNMEGcwiaA7HU4dVHx1787277AA= X-Google-Smtp-Source: AGRyM1ullGqlvrpom1Xn9DZ2Ui4jgJ/ZldNbMfLrpuCzq74NU7liQHodlFYQTaWOqkGLzAfLZCIuEg== X-Received: by 2002:ac2:4e0c:0:b0:489:e6c8:47e9 with SMTP id e12-20020ac24e0c000000b00489e6c847e9mr16679519lfr.666.1658232633065; Tue, 19 Jul 2022 05:10:33 -0700 (PDT) X-Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:32 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-devel] [edk2-platforms][PATCH 01/10] Ext4Pkg: Replace SetMem(,,0) with ZeroMem Date: Tue, 19 Jul 2022 18:10:07 +0600 Message-Id: <20220719121016.29380-2-savvamtr@gmail.com> In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,savvamtr@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658424089; bh=7n2ouNMa8AGgos4pW0WBdvDAB0SttUIdjRams7ct/CA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=RWEGIXn9q3uCkbDT5VAdA+4j1We0JbuSc200qBbwigVbBXkbuMYvQmxt7WbcwDbXaiY FYCbbIZvV3nBJZUyH3xLsrcTxxNxIp8kc7BUuWYsVipMtKcK2IwjnPgEWDPwhREiaxzX/ NE9WLrL2HlRAySMw2lGn+2/GwsJGmJvna6I= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658424091432100004 Content-Type: text/plain; charset="utf-8" Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Inode.c b/Features/Ext4Pkg/Ext4Dxe/In= ode.c index 831f5946e870..142ee6e3d78a 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Inode.c +++ b/Features/Ext4Pkg/Ext4Dxe/Inode.c @@ -158,7 +158,7 @@ Ext4Read ( WasRead =3D HoleLen > RemainingRead ? RemainingRead : HoleLen; // Potential improvement: In the future, we could get the file hole'= s total // size and memset all that - SetMem (Buffer, WasRead, 0); + ZeroMem (Buffer, WasRead); } else { ExtentStartBytes =3D MultU64x32 ( LShiftU64 (Extent.ee_start_hi, 32) | @@ -431,7 +431,7 @@ Ext4FileCreateTime ( Inode =3D File->Inode; =20 if (!EXT4_INODE_HAS_FIELD (Inode, i_crtime)) { - SetMem (Time, sizeof (EFI_TIME), 0); + ZeroMem (Time, sizeof (EFI_TIME)); return; } =20 --=20 2.37.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91647): https://edk2.groups.io/g/devel/message/91647 Mute This Topic: https://groups.io/mt/92531463/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 14:03:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91648+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91648+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658424090; cv=none; d=zohomail.com; s=zohoarc; b=hT86hxQ05+eZvYpRIi9mdL4xymZkVQXDYaTXj6f3dIDVCc5J8vbSSagX2nj/vbocHclXuwba7CwsbopPqWo0gn3Jubn1+gVuSUKueqieyb5ozGieqUG83i3u1kHYcPvN8xsBQc7GRYaWes1vnmOT54owOOkq5WJgfBAPC5SelWk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658424090; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=p1Xi74QoM9mOv/2VHxKRoanjFUYhBo7tF8lU5mrF7pM=; b=DkQ6ZUgPpFE0IgHj7YWYHl/DlWypn4M9YDuAQvPLfZvPuUk9tMuh7Dc4r5WQonXfKUJl2nicnXWyJE4tin/o7YTgJrF6UNwq709e2510/kedPhm02rcmKJLyWvu9Syr23tQa5OugNT1R/YqGOlNY+P6UqIaXLLCvfz9vEv57/tE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91648+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1658424090650242.09062206279873; Thu, 21 Jul 2022 10:21:30 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id x3RdYY1788612xbQQrrorWPh; Thu, 21 Jul 2022 10:21:30 -0700 X-Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mx.groups.io with SMTP id smtpd.web09.39655.1658232636804486424 for ; Tue, 19 Jul 2022 05:10:37 -0700 X-Received: by mail-lf1-f45.google.com with SMTP id u13so24426607lfn.5 for ; Tue, 19 Jul 2022 05:10:36 -0700 (PDT) X-Gm-Message-State: XmQvIIe8B8WiYhyI0dXTaXiyx1787277AA= X-Google-Smtp-Source: AGRyM1sYv+L7HxIfYd5aRnZUG1wmjuUGCCBfRVMD1mt0VkaLq0LK8OzGhwpSBdbCsUTiRSoRGZsUXQ== X-Received: by 2002:a05:6512:3c8c:b0:489:e80f:ea33 with SMTP id h12-20020a0565123c8c00b00489e80fea33mr16307833lfv.347.1658232634766; Tue, 19 Jul 2022 05:10:34 -0700 (PDT) X-Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:34 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-devel] [edk2-platforms][PATCH 02/10] Ext4Pkg: Change HoleLen type to UINT64 Date: Tue, 19 Jul 2022 18:10:08 +0600 Message-Id: <20220719121016.29380-3-savvamtr@gmail.com> In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,savvamtr@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658424090; bh=TNFaRQrmpdrb30bhJxy+DUALiISa0d5XzJCaEDW8Dq4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=u1w4RSg7j26EQRSg1g/dmv7y08GQdjfXwfPZm1IHIQKePzOrvTIIYEgaYcoGeD6Dv9c 83Ug40lWi4TD2rkJOpYqc3Ir8uHVxBNkZatzdeBHNCMlBj2PVYok3Y6nDKp9vsoFih8+V ZvOpwJsT9aSWn/gShK2K/zbsqaWJ75AChME= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658424091423100002 Content-Type: text/plain; charset="utf-8" Set HoleLen to UINT64 to perform safe cast to UINTN in ternary operator at WasRead assignment Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Inode.c b/Features/Ext4Pkg/Ext4Dxe/In= ode.c index 142ee6e3d78a..6416f5388486 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Inode.c +++ b/Features/Ext4Pkg/Ext4Dxe/Inode.c @@ -100,7 +100,7 @@ Ext4Read ( EFI_STATUS Status; BOOLEAN HasBackingExtent; UINT32 HoleOff; - UINTN HoleLen; + UINT64 HoleLen; UINT64 ExtentStartBytes; UINT64 ExtentLengthBytes; UINT64 ExtentLogicalBytes; @@ -155,7 +155,7 @@ Ext4Read ( HoleLen =3D (Ext4GetExtentLength (&Extent) * Partition->BlockSize)= - HoleOff; } =20 - WasRead =3D HoleLen > RemainingRead ? RemainingRead : HoleLen; + WasRead =3D HoleLen > RemainingRead ? RemainingRead : (UINTN) HoleLe= n; // Potential improvement: In the future, we could get the file hole'= s total // size and memset all that ZeroMem (Buffer, WasRead); --=20 2.37.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91648): https://edk2.groups.io/g/devel/message/91648 Mute This Topic: https://groups.io/mt/92531464/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 14:03:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91649+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91649+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658424090; cv=none; d=zohomail.com; s=zohoarc; b=MiGu7ur7vXMeaXBCXna1eyGs8CW5jN1wafhuk1FR0FZbvvlGvN86wIYpzWmG92dVDNINET04VXyyGHV4MDcLZ2KICJpJKUbppwzw7gTWWfJtzxX67YkSU4vJXE9w4QfvkJDy0eqgGLtD40UmQkzAylU/OYuCRcotCF/6eCDPUEk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658424090; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=7Hl7/Gn/D1Bi/TSlz3zzfiVf8a6NIgIK8KY0f1lJkAA=; b=DbxTBGR7dZ22npUun/ydUp4Vi3DUB6fevZ3u35lPjxgg2gD1jk4QrvmMhlvGT7MdyPaT+L1U0zdFIzOKDSIYdCApAnvoiGyrKIOPMMe0Axpv4OkV6xd85uOeOIrlxPDXfZslMDmyJGEU9hiWF4uSJws/3/+elZgxIBIGkQPK2t0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91649+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1658424090406907.9540185408682; Thu, 21 Jul 2022 10:21:30 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id N19DYY1788612xHc4tqw0Xdm; Thu, 21 Jul 2022 10:21:30 -0700 X-Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mx.groups.io with SMTP id smtpd.web08.39781.1658232638355434988 for ; Tue, 19 Jul 2022 05:10:38 -0700 X-Received: by mail-lf1-f43.google.com with SMTP id a9so24398214lfk.11 for ; Tue, 19 Jul 2022 05:10:38 -0700 (PDT) X-Gm-Message-State: ve5rVXEXDOaX4xqtMGZ0rshxx1787277AA= X-Google-Smtp-Source: AGRyM1ujED6NxZDnNXk2Yt3BKor9jx9x1HTdDAJ6riyOuqy6qBE0jwWEjdNxA93jWXHqMOOFvVaLoA== X-Received: by 2002:a05:6512:32c8:b0:48a:10da:b204 with SMTP id f8-20020a05651232c800b0048a10dab204mr15122631lfg.183.1658232636416; Tue, 19 Jul 2022 05:10:36 -0700 (PDT) X-Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:36 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-devel] [edk2-platforms][PATCH 03/10] Ext4Pkg: Use 32-bit block number in BlockMap Date: Tue, 19 Jul 2022 18:10:09 +0600 Message-Id: <20220719121016.29380-4-savvamtr@gmail.com> In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,savvamtr@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658424090; bh=Wccqv84iORCOihlNf+be3Mj+MUBZCIg9ZJcfWMQTvq8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=xG+KBvFc0uC+8Jwf+2wFUUk4kDRKAQCqRvH8LtN0k4q0LvCtQ9C4257aad4caP9muJr cUPIWOY/pXwXcsUu9nXsK5BWfvBMp62C0M6jJluMdAz0/RQXeZxesmqvKUE3F0kmxb6bP aHLMEBzTpG1L+oYtrZIZiU7xiTH8tatZ2TI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658424091448100005 Content-Type: text/plain; charset="utf-8" Replace EXT4_BLOCK_NR with 32-bit EXT2_BLOCK_NR in BlockMap, because we consider BlockMap is 32-bit fs ext2/3 feature Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h | 1 + Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h | 2 +- Features/Ext4Pkg/Ext4Dxe/BlockMap.c | 14 ++++++++++---- Features/Ext4Pkg/Ext4Dxe/Extents.c | 3 ++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h b/Features/Ext4Pkg/Ext4Dxe= /Ext4Disk.h index a55cd2fa68ad..3aef6f0e5bb4 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h +++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h @@ -463,6 +463,7 @@ typedef struct { #define EXT4_EXTENT_MAX_INITIALIZED (1 << 15) =20 typedef UINT64 EXT4_BLOCK_NR; +typedef UINT32 EXT2_BLOCK_NR; typedef UINT32 EXT4_INO_NR; =20 // 2 is always the root inode number in ext4 diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h b/Features/Ext4Pkg/Ext4Dxe/= Ext4Dxe.h index b1508482b0a7..b446488b2112 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h +++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h @@ -1165,7 +1165,7 @@ EFI_STATUS Ext4GetBlocks ( IN EXT4_PARTITION *Partition, IN EXT4_FILE *File, - IN EXT4_BLOCK_NR LogicalBlock, + IN EXT2_BLOCK_NR LogicalBlock, OUT EXT4_EXTENT *Extent ); =20 diff --git a/Features/Ext4Pkg/Ext4Dxe/BlockMap.c b/Features/Ext4Pkg/Ext4Dxe= /BlockMap.c index 1a06ac9fbf86..3d9e16035bee 100644 --- a/Features/Ext4Pkg/Ext4Dxe/BlockMap.c +++ b/Features/Ext4Pkg/Ext4Dxe/BlockMap.c @@ -70,7 +70,7 @@ UINTN Ext4GetBlockPath ( IN CONST EXT4_PARTITION *Partition, IN UINT32 LogicalBlock, - OUT EXT4_BLOCK_NR BlockPath[EXT4_MAX_BLOCK_PATH] + OUT EXT2_BLOCK_NR BlockPath[EXT4_MAX_BLOCK_PATH] ) { // The logic behind the block map is very much like a page table @@ -213,12 +213,12 @@ EFI_STATUS Ext4GetBlocks ( IN EXT4_PARTITION *Partition, IN EXT4_FILE *File, - IN EXT4_BLOCK_NR LogicalBlock, + IN EXT2_BLOCK_NR LogicalBlock, OUT EXT4_EXTENT *Extent ) { EXT4_INODE *Inode; - EXT4_BLOCK_NR BlockPath[EXT4_MAX_BLOCK_PATH]; + EXT2_BLOCK_NR BlockPath[EXT4_MAX_BLOCK_PATH]; UINTN BlockPathLength; UINTN Index; UINT32 *Buffer; @@ -272,7 +272,13 @@ Ext4GetBlocks ( } } =20 - Ext4GetExtentInBlockMap (Buffer, Partition->BlockSize / sizeof (UINT32),= BlockPath[BlockPathLength - 1], Extent); + Ext4GetExtentInBlockMap ( + Buffer, + Partition->BlockSize / sizeof (UINT32), + BlockPath[BlockPathLength - 1], + Extent + ); + FreePool (Buffer); =20 return EFI_SUCCESS; diff --git a/Features/Ext4Pkg/Ext4Dxe/Extents.c b/Features/Ext4Pkg/Ext4Dxe/= Extents.c index c3874df71751..c5951f78aa62 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Extents.c +++ b/Features/Ext4Pkg/Ext4Dxe/Extents.c @@ -259,7 +259,8 @@ Ext4GetExtent ( =20 if (!(Inode->i_flags & EXT4_EXTENTS_FL)) { // If this is an older ext2/ext3 filesystem, emulate Ext4GetExtent usi= ng the block map - Status =3D Ext4GetBlocks (Partition, File, LogicalBlock, Extent); + // We cast LogicalBlock to UINT32, considering ext2/3 are 32-bit + Status =3D Ext4GetBlocks (Partition, File, (UINT32) LogicalBlock, Exte= nt); =20 if (!EFI_ERROR (Status)) { Ext4CacheExtents (File, Extent, 1); --=20 2.37.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91649): https://edk2.groups.io/g/devel/message/91649 Mute This Topic: https://groups.io/mt/92531465/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 14:03:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91650+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91650+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658424091; cv=none; d=zohomail.com; s=zohoarc; b=VUE9/dTwiWBRmVE8DEiC2jfw74gxsndQL8om9QFyMc0obrsst/NC/J+3RqVHrxUg9C3g+PiphornQNPcucgnvX0gek07VHsJK8xNOQHtu5NMZlpjflKBA8P3RxR2B/OsF1zPfI71Z0jKtTZDNBSL/SqN8lGHPc5z0QYQHTyGi1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658424091; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=onV0gY/1/2qft4+nU42Ig++mCkewBIP6uXaPqpU71Ts=; b=LTtZty4d+mG4GcGEHgbkyY0fbfaDLNmG0YUyWoupIobSy7c7uh3+UuMPlCTYVKsUisn4itCj9ksaiOo5JwWIUGYwiIW0v5Jh+QJdoWePvulDU6uACpB4Fw9QTNs2xGSAKMcgmAamzDPH23dFD327MdVHioeQgJX1oapR8R9t/aM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91650+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1658424091441243.4380087033163; Thu, 21 Jul 2022 10:21:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3VytYY1788612xt4IW8QFiSw; Thu, 21 Jul 2022 10:21:31 -0700 X-Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by mx.groups.io with SMTP id smtpd.web11.39808.1658232639998351887 for ; Tue, 19 Jul 2022 05:10:40 -0700 X-Received: by mail-lj1-f181.google.com with SMTP id v15so13383512ljc.1 for ; Tue, 19 Jul 2022 05:10:39 -0700 (PDT) X-Gm-Message-State: qOFeZFhfyUBkqWoMsA4BCIfEx1787277AA= X-Google-Smtp-Source: AGRyM1u5H5yJ3nH9Ps5OU2gv65jtJnv3tIzFyQLkvuL4M5LQrVF6uJ4cDvATy5GJYF4bxScm03u+9w== X-Received: by 2002:a2e:9dd0:0:b0:25d:46d7:6bd with SMTP id x16-20020a2e9dd0000000b0025d46d706bdmr14464072ljj.502.1658232638067; Tue, 19 Jul 2022 05:10:38 -0700 (PDT) X-Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:37 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-devel] [edk2-platforms][PATCH 04/10] Ext4Pkg: Use assertion in Ext4CalculateChecksum Date: Tue, 19 Jul 2022 18:10:10 +0600 Message-Id: <20220719121016.29380-5-savvamtr@gmail.com> In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,savvamtr@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658424091; bh=/GLPqArL7TfOp/Npi10gT+sFMZZYoxlZAbJ8U+miqVI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=LhLVi8LAh6N9cI5mnJKGGbSAFE1rtXvVGXJOO2lvqGeHQT8ddp//EKdMEciVkdxKTFw LqOMUT7dakN3HEEhYVlL0sMtsqUBb0WKpUf2rWh70NB+zmy5i5dgQEJEKc1Ockge+gaar liis0mH6S5rdoscgWrlqPMF8QbrdpwnG8QU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658424093459100015 Content-Type: text/plain; charset="utf-8" Replaced UNREACHABLE with ASSERT (FALSE) in case of new checksum algorithms, due to it is an invariant violation rather than unreachable path Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Superblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Superblock.c b/Features/Ext4Pkg/Ext4D= xe/Superblock.c index 47fc3a65507a..42762b6aa780 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Superblock.c +++ b/Features/Ext4Pkg/Ext4Dxe/Superblock.c @@ -342,7 +342,7 @@ Ext4CalculateChecksum ( // For some reason, EXT4 really likes non-inverted CRC32C checksums,= so we stick to that here. return ~CalculateCrc32c(Buffer, Length, ~InitialValue); default: - UNREACHABLE (); + ASSERT (FALSE); return 0; } } --=20 2.37.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91650): https://edk2.groups.io/g/devel/message/91650 Mute This Topic: https://groups.io/mt/92531466/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 14:03:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91651+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91651+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658424091; cv=none; d=zohomail.com; s=zohoarc; b=X2pcsw3QUsjvjsIP37M1Sufgxa5Nk5ipVvEHhUVH+n0mXmLt2eQws2w7w2GTUu3Yc3K0t1g1TiGbsb1Kaw0wQ8mcHdB65Zl1p1FJX/QBgx9qt2xLFItq6ZNGOs7JyE3MrAqJ+7elpU98/3KvpTfIgL5fO+oPHp+bX7UP/VyT6C4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658424091; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=IPnwaJEO8Bq8Ge+Nm5mYgMHutqiET22xs8A8ph/mthI=; b=GficvtmvJqc6Qv3/2XX9imHWcQz1p2qSBxuduNELbA8odtnbEd7DB0A4BuEZibo4dE/CWUO0oLvUkGgYzXkjvrkiVXSym/AtEIuGaVcGIy8ESaQbRvocAQp3W4Hl9W55KuO5QolyXazSW4jTZB2Bhipc8HGDABDPtgs3kgtCdn0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91651+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 165842409102029.553597651322207; Thu, 21 Jul 2022 10:21:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 92qmYY1788612xKWbwZZLjn0; Thu, 21 Jul 2022 10:21:30 -0700 X-Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mx.groups.io with SMTP id smtpd.web10.39909.1658232641880989845 for ; Tue, 19 Jul 2022 05:10:42 -0700 X-Received: by mail-lf1-f41.google.com with SMTP id t1so24368335lft.8 for ; Tue, 19 Jul 2022 05:10:41 -0700 (PDT) X-Gm-Message-State: MY28X42XLwVDfh43NLOLBdLCx1787277AA= X-Google-Smtp-Source: AGRyM1vHy05Zp6fHo8qhFH+1gCMtd+bejBWhefJr1Smaa3hLlp27K3QSWIi7Ai6lW91Y7s6vXxiR+Q== X-Received: by 2002:ac2:4d92:0:b0:486:5abb:de57 with SMTP id g18-20020ac24d92000000b004865abbde57mr16731499lfe.502.1658232639873; Tue, 19 Jul 2022 05:10:39 -0700 (PDT) X-Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:39 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-devel] [edk2-platforms][PATCH 05/10] Ext4Pkg: Fix compiler warnings Date: Tue, 19 Jul 2022 18:10:11 +0600 Message-Id: <20220719121016.29380-6-savvamtr@gmail.com> In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,savvamtr@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658424090; bh=GvIViInaleATFU3z1SlBqXdhGiEeM9Rzea4QBctPkHM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=wLK82IkjnETovu9R7GJz7d3wIPs0aTu5qAd3+NFeVpriVXEOE5x4mV341VoJ2tRoZ7B 0aYSt3RpSUu5h1LD/zBK5HNG3Zw2FqhPUdCur2VxFhhfgTNsiKeYXhikdMdKhZ6LrNXoD RElvhy0blA9MiaG4cTJQ11Clv1HjvjMgHAU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658424091430100003 Content-Type: text/plain; charset="utf-8" Initialize all fields in gExt4BindingProtocol. Fix comparison of integer expressions of different signedness. Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h | 2 +- Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h b/Features/Ext4Pkg/Ext4Dxe= /Ext4Disk.h index 3aef6f0e5bb4..7a19d2f79d53 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h +++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h @@ -338,7 +338,7 @@ STATIC_ASSERT ( #define EXT4_TIND_BLOCK 14 #define EXT4_NR_BLOCKS 15 =20 -#define EXT4_GOOD_OLD_INODE_SIZE 128 +#define EXT4_GOOD_OLD_INODE_SIZE 128U =20 typedef struct _Ext4_I_OSD2_Linux { UINT16 l_i_blocks_high; diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c b/Features/Ext4Pkg/Ext4Dxe/= Ext4Dxe.c index 43b9340d3956..2a4f5a7bd0ef 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c +++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c @@ -260,10 +260,12 @@ Ext4Stop ( =20 EFI_DRIVER_BINDING_PROTOCOL gExt4BindingProtocol =3D { - Ext4IsBindingSupported, - Ext4Bind, - Ext4Stop, - EXT4_DRIVER_VERSION + .Supported =3D Ext4IsBindingSupported, + .Start =3D Ext4Bind, + .Stop =3D Ext4Stop, + .Version =3D EXT4_DRIVER_VERSION, + .ImageHandle =3D NULL, + .DriverBindingHandle =3D NULL }; =20 /** --=20 2.37.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91651): https://edk2.groups.io/g/devel/message/91651 Mute This Topic: https://groups.io/mt/92531467/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 14:03:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91652+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91652+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658424091; cv=none; d=zohomail.com; s=zohoarc; b=I4ckRa2S4ogariTD2wrQiUoj6BTP7qjFhpYwQ2LbMmm5NI2LmSR7JG0lcrAJvRPhXeALT0LtWt6GM2U5b0wcUD3ObxRr2c0SclAISlUecH0hqUwlboH+25OPxLD3bevsd7kWDWkyr2oEE4f03u+MrToWsg5XJxB7eR1sxei0yOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658424091; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=e4Wc6aN219B6fewTlEW3MPBb9bBC7QDXyh6CocPOEnM=; b=alIrUkM60ugR9rEqCA8yYsX0ez+a8qSdNMKd2WYwqr6r2/VYRotbA47cefSGOXcFwBqFPK1RV1cKVs+Ppkxd6lfSQkPZLXpC7UdRBneesIZ5REFHGn0QQlVps1YyFRJgvGXaun6xCW6+L9/K8tMYtyh+1gEiZn2mDdZXWRaZdN4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91652+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1658424091990192.355111042359; Thu, 21 Jul 2022 10:21:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id F2odYY1788612xbQx2yAJVIA; Thu, 21 Jul 2022 10:21:31 -0700 X-Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by mx.groups.io with SMTP id smtpd.web11.39809.1658232643333907367 for ; Tue, 19 Jul 2022 05:10:43 -0700 X-Received: by mail-lj1-f171.google.com with SMTP id by8so13518848ljb.13 for ; Tue, 19 Jul 2022 05:10:43 -0700 (PDT) X-Gm-Message-State: oIebGSVFhDLvihPC0Ubo393qx1787277AA= X-Google-Smtp-Source: AGRyM1vVFkI6FQ6LU6kNnsKBkcM90Hw98m6Akv0ScldcMdAKWxsEgd2UvI9fn4sTVDwpv3bwrXCrnQ== X-Received: by 2002:a2e:a7cf:0:b0:25d:6b92:9c1a with SMTP id x15-20020a2ea7cf000000b0025d6b929c1amr13814596ljp.107.1658232641464; Tue, 19 Jul 2022 05:10:41 -0700 (PDT) X-Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:41 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-devel] [edk2-platforms][PATCH 06/10] Ext4Pkg: Drop dir entry name_len limit extra check Date: Tue, 19 Jul 2022 18:10:12 +0600 Message-Id: <20220719121016.29380-7-savvamtr@gmail.com> In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,savvamtr@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658424091; bh=tfnbq1J/mC6QbXdwJiA88xiDCjw+jev1oolbjl70Z6k=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=tp1hWUSd3IIoVxhH636Gy5Mxvn+9zq7AfUatu/l3RRECk7Zbw/Hvth4XRymGnLExFJ8 XBit/qy4tAB2jm0nX+SbkFaIsj0kF8zhDaH87Kjps8co0mOu5eDr8mm68lpchdVwIGXva 3URUD2hm8P88r4ZHTy4DFoOC7TuZD9so3YY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658424093468100016 Content-Type: text/plain; charset="utf-8" Field name_len has type CHAR8, while filename limit is 255 (EXT4_NAME_MAX), so because structure EXT4_DIR_ENTRY would be unchangeable in future, we could drop this check without any assertions Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Directory.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Directory.c b/Features/Ext4Pkg/Ext4Dx= e/Directory.c index 682f66ad5525..96c84c24243e 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Directory.c +++ b/Features/Ext4Pkg/Ext4Dxe/Directory.c @@ -160,17 +160,6 @@ Ext4RetrieveDirent ( return EFI_VOLUME_CORRUPTED; } =20 - // Ignore names bigger than our limit. - - /* Note: I think having a limit is sane because: - 1) It's nicer to work with. - 2) Linux and a number of BSDs also have a filename limit of 255. - */ - if (Entry->name_len > EXT4_NAME_MAX) { - BlockOffset +=3D Entry->rec_len; - continue; - } - // Unused entry if (Entry->inode =3D=3D 0) { BlockOffset +=3D Entry->rec_len; --=20 2.37.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91652): https://edk2.groups.io/g/devel/message/91652 Mute This Topic: https://groups.io/mt/92531468/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 14:03:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91653+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91653+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658424093; cv=none; d=zohomail.com; s=zohoarc; b=RRUKpJvHHzjcJjLPuDzI163zHrG/dRYcKCBY1P/NlrKZssxMgem7CQ4OhRyoAh+tO6pUwhDdNhVVVIuxiqwRrmcDyrq3fBgo8E5yVCfXCteSmHORcztSLJ2grtQBxa5jrPYZuPpcaaHWzVjxZajowvJIR46CQPGQ7PZ1DpsHU4U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658424093; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ZI/zzE2WUZ6lhFvx/MxVBb1Yc2+xGivvVwyjOVJYDuE=; b=m7JZ3xbWtxQIQAX60qMISPv5d291xE2gwVS78NqJc4R5TJZ9czVi7ekw+vIKqfIB+HJXeObB86jL3fTuz/JR4Pewn+2SW2XnBcxc9E5Nne12vb/P7kBPkzwo7iN5B34AJr5weMDYywLGWdgzuhLdOHNvmu/vJ43fS+6ddoSQpfg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91653+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1658424093235469.54689253234835; Thu, 21 Jul 2022 10:21:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UxX4YY1788612x0RcdbzItRV; Thu, 21 Jul 2022 10:21:32 -0700 X-Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by mx.groups.io with SMTP id smtpd.web12.39755.1658232645099588572 for ; Tue, 19 Jul 2022 05:10:45 -0700 X-Received: by mail-lf1-f54.google.com with SMTP id bp17so24434871lfb.3 for ; Tue, 19 Jul 2022 05:10:44 -0700 (PDT) X-Gm-Message-State: r9jW24dHmqtPr2imRaR9PC2Cx1787277AA= X-Google-Smtp-Source: AGRyM1vxeWNCASzq/rwNMlZWBKqFe6wkaMdj4MymN6i+LEb1unEUTfsxwUmThOTO1wN3UO1QIbx7ug== X-Received: by 2002:a05:6512:2315:b0:489:cbc1:886a with SMTP id o21-20020a056512231500b00489cbc1886amr16084471lfu.428.1658232643176; Tue, 19 Jul 2022 05:10:43 -0700 (PDT) X-Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:42 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-devel] [edk2-platforms][PATCH 07/10] Ext4Pkg: Simplify Ext4RemoveDentry logic Date: Tue, 19 Jul 2022 18:10:13 +0600 Message-Id: <20220719121016.29380-8-savvamtr@gmail.com> In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,savvamtr@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658424092; bh=1Z5SxMpmoor3SBnHXoaB0GK8KY0zHuQLqayhaihzStQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=N2oG2EbIEQNwT42llswSR19ScCBiYqco8exNlNbSDiTZ2OfPsD08I+8L76upq+7UsVJ 0Cuv+Q8ZjEiobaKbrVrpEZ2ERw3oXIb4kzefclPCRPqGMQMqqeCeJRTh66+75fg6e3DpH GFH1AwkvHjt8hSNCQ9uGxNGHu3ZFoNNhiIY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658424095433100027 Content-Type: text/plain; charset="utf-8" First of all BASE_LIST_FOR_EACH_SAFE doesn't have any sanity checks. So its usage isn't "safe". We can drop this loop and use just IsNodeInList Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Directory.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Directory.c b/Features/Ext4Pkg/Ext4Dx= e/Directory.c index 96c84c24243e..d1038c04926e 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Directory.c +++ b/Features/Ext4Pkg/Ext4Dxe/Directory.c @@ -537,20 +537,8 @@ Ext4RemoveDentry ( IN OUT EXT4_DENTRY *ToBeRemoved ) { - EXT4_DENTRY *D; - LIST_ENTRY *Entry; - LIST_ENTRY *NextEntry; - - BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Parent->Children) { - D =3D EXT4_DENTRY_FROM_DENTRY_LIST (Entry); - - if (D =3D=3D ToBeRemoved) { - RemoveEntryList (Entry); - return; - } - } - - DEBUG ((DEBUG_ERROR, "[ext4] Ext4RemoveDentry did not find the asked-for= dentry\n")); + ASSERT (IsNodeInList (&ToBeRemoved->ListNode, &Parent->Children)); + RemoveEntryList (&ToBeRemoved->ListNode); } =20 /** --=20 2.37.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91653): https://edk2.groups.io/g/devel/message/91653 Mute This Topic: https://groups.io/mt/92531469/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 14:03:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91654+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91654+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658424093; cv=none; d=zohomail.com; s=zohoarc; b=mEctq7x3LKqBtve3MEl6WJFMu+9FI1iss2EmX7GHog3t6v0VfCJKGxF3VMZEzGrn411wI8PCWljro7JONw5cDf9t1PsBhGUlihv9V026+bAKYqWXAK30anGKdq2sN+Re5vkoPcLf2k7eKdPyz+9TYqSNr0xPwk2tRaDbM2lhdRE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658424093; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=7kq0/d8PQB9wUQ2ktEOpPHEURojPP0GeEavDUZ4VBEY=; b=QZp9V4JtTbd8sfhHhTfzTftJJ0NXjJsWQudRa1mYhWzTlvkhAzLSPweEMyOUfMrRSdupnp77d2LPdjMMyVzh8CIxyfZ7UuJ2KTsh5W3sBZfaYavESCffZtvyp5vI+iQT67HS8GDtO04UnVecFxoC8P1748IteDZW1rTHkQrtrhk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91654+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1658424093330325.3481169942545; Thu, 21 Jul 2022 10:21:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id DuudYY1788612x1tF4310jyF; Thu, 21 Jul 2022 10:21:33 -0700 X-Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by mx.groups.io with SMTP id smtpd.web10.39911.1658232646669148933 for ; Tue, 19 Jul 2022 05:10:47 -0700 X-Received: by mail-lj1-f178.google.com with SMTP id o12so17130912ljc.3 for ; Tue, 19 Jul 2022 05:10:46 -0700 (PDT) X-Gm-Message-State: xI71xIcDjhUSQ8VUVeMCJQQbx1787277AA= X-Google-Smtp-Source: AGRyM1uxVITCvi/XrhoOv7fzAPNdFrVkLsXHbt0q8FrmlDGzpnnfV1Njm4xL2QxpMHVBJ0D5aQeUQQ== X-Received: by 2002:a2e:ba15:0:b0:25d:67ca:873 with SMTP id p21-20020a2eba15000000b0025d67ca0873mr13959252lja.428.1658232644781; Tue, 19 Jul 2022 05:10:44 -0700 (PDT) X-Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:44 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-devel] [edk2-platforms][PATCH 08/10] Ext4Pkg: Fix possible int overflow in Ext4ExtentsMapKeyCompare Date: Tue, 19 Jul 2022 18:10:14 +0600 Message-Id: <20220719121016.29380-9-savvamtr@gmail.com> In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,savvamtr@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658424093; bh=4wnfRw2lyKGXy4Ua57KnVzOciizI3XeMKDpWCOOZWuI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=nx5o5vN0CrsXHaPK5Dng5M9n76uUOhRzV+8yojKyG5DZ58vYrEQcD6fiTAxKfeHgn+F 2z0Y5rC1/11lqE+oNloQi3PadpTH91/hg6oFr14PieuvXv525D+/IYCwVIicPs8dv0a5g FqlQD47Zsd54L2MNoeLi/vKg34dpWd0W+8w= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658424095435100028 Content-Type: text/plain; charset="utf-8" Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Extents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Extents.c b/Features/Ext4Pkg/Ext4Dxe/= Extents.c index c5951f78aa62..80427d869bd3 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Extents.c +++ b/Features/Ext4Pkg/Ext4Dxe/Extents.c @@ -421,7 +421,7 @@ Ext4ExtentsMapKeyCompare ( Extent =3D UserStruct; Block =3D (UINT32)(UINTN)StandaloneKey; =20 - if ((Block >=3D Extent->ee_block) && (Block < Extent->ee_block + Ext4Get= ExtentLength (Extent))) { + if ((Block >=3D Extent->ee_block) && (Block - Extent->ee_block < Ext4Get= ExtentLength (Extent))) { return 0; } =20 --=20 2.37.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91654): https://edk2.groups.io/g/devel/message/91654 Mute This Topic: https://groups.io/mt/92531470/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 14:03:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91655+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91655+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658424093; cv=none; d=zohomail.com; s=zohoarc; b=W258QwWsbQWKoA3AhkQtjfsp2uWmLK4FeszYxHpStbMWYYEM7Ai+ehF2/oRO4xxj9YMhVc/4ZmKJYiP4iT8SfAXOs9pyDR8dpQPN6JQh/sSUxRRjkrPSK1xo8wMGu0nn8KJd/ocu10jvVnQy7x6Mfz15WE9qlET9eBoTDkcOVJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658424093; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=MA7HHb5rx/fOeYW7BBE02B83PB72i0qJTENdG+RI21w=; b=mDV7X64D6tdpCfBBtMlHveqIEIWf/fikDxi85FjgjCS2O5kK0tpgHNy9pLBz1qzvOrcKNL14ISXIQRUAwjpKGtmenBvI359H/W9cXxabPSiyScPRp+yQV9HpNDD8ZIF4UEQbGtuQ8Gu3HHbDNzrIgAjEkGkA67+9jDei4TOf3oU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91655+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16584240937081004.5172678537909; Thu, 21 Jul 2022 10:21:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id j144YY1788612xTpbs5Q4zsO; Thu, 21 Jul 2022 10:21:33 -0700 X-Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by mx.groups.io with SMTP id smtpd.web12.39756.1658232648358838173 for ; Tue, 19 Jul 2022 05:10:48 -0700 X-Received: by mail-lj1-f175.google.com with SMTP id q7so17089622lji.12 for ; Tue, 19 Jul 2022 05:10:48 -0700 (PDT) X-Gm-Message-State: YjON7trDX1MOusyWx0GOFG9Bx1787277AA= X-Google-Smtp-Source: AGRyM1sgWL7vG7kZrOZOAB787PZIW7lQSUZgaYvbye3gxW1HkgTJTY5pU0nyu7yrkKVorDSJZHXVXA== X-Received: by 2002:a2e:87c8:0:b0:25d:776c:8343 with SMTP id v8-20020a2e87c8000000b0025d776c8343mr14253051ljj.268.1658232646513; Tue, 19 Jul 2022 05:10:46 -0700 (PDT) X-Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:46 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-devel] [edk2-platforms][PATCH 09/10] Ext4Pkg: Return bad block type in Ext4GetBlockpath Date: Tue, 19 Jul 2022 18:10:15 +0600 Message-Id: <20220719121016.29380-10-savvamtr@gmail.com> In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,savvamtr@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658424093; bh=8yL4+gBdUq8j4VvHht43XFmFkTQzg4dNMsT/1KG0uEk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=mbKORNQmFz8gRvswrhKy2WgprF/19R6JZ+uOrpAoXhl6BPJBCdtuA/Irsfmlm35hbuc /ocGBaK+koL0ua5XpslrskC5ya0C79t1JtEVTHgxvBK4k90WoamvcdpwCqpT6BOwkeMUX /5bsuwLX+gOYhwQiTYbUAKc27Jh7jgGOw1I= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658424095442100029 Content-Type: text/plain; charset="utf-8" Seems that returning maximum uintn in case of bad block was a mistake, so return just bad block type Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/BlockMap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/BlockMap.c b/Features/Ext4Pkg/Ext4Dxe= /BlockMap.c index 3d9e16035bee..2bc629fe9d38 100644 --- a/Features/Ext4Pkg/Ext4Dxe/BlockMap.c +++ b/Features/Ext4Pkg/Ext4Dxe/BlockMap.c @@ -123,7 +123,7 @@ Ext4GetBlockPath ( break; default: // EXT4_TYPE_BAD_BLOCK - return -1; + break; } =20 return Type + 1; @@ -230,7 +230,7 @@ Ext4GetBlocks ( =20 BlockPathLength =3D Ext4GetBlockPath (Partition, LogicalBlock, BlockPath= ); =20 - if (BlockPathLength =3D=3D (UINTN)-1) { + if (BlockPathLength - 1 =3D=3D EXT4_TYPE_BAD_BLOCK) { // Bad logical block (out of range) return EFI_NO_MAPPING; } --=20 2.37.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91655): https://edk2.groups.io/g/devel/message/91655 Mute This Topic: https://groups.io/mt/92531471/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 14:03:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91656+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91656+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658424094; cv=none; d=zohomail.com; s=zohoarc; b=BtavmFm8+aZw2UANnod3zgF2Sn4lfbRbzUw+57vSAS4DhuinTDSxt6mZ8i7yvrLJjJjMnMbpbsQb59PSnizreNvhxdfh9m4+EA/dcqywpgZlEizwHetpW9u/oqodWDzCO4tOEgtXuM9kwma6TpyYYWvhuY8ZoPVO2tC3XQW72G0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658424094; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=KsyKm2YDLs73tMjYKwX/jWx32QI+ZoPGTBWzU3Y/snk=; b=JHbF35xXnlzEJSeB1gvF17aL9PcrowIih4NKCRGTAxTm78OA1iePPKRsNH5UKIHzSeELlvolYe6iMdG7K+AWEoLOld+69omLGlKqL7jqMA9fc3jfNv6XAGjPkazcRHaHk1YkUd3t/lJh4zYKw3JnZyfipVz4MUdn6CrvoJZ5qDY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91656+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1658424094211780.5853012809008; Thu, 21 Jul 2022 10:21:34 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id yI6xYY1788612x4JcezydZRK; Thu, 21 Jul 2022 10:21:33 -0700 X-Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mx.groups.io with SMTP id smtpd.web08.39781.1658232638355434988 for ; Tue, 19 Jul 2022 05:10:49 -0700 X-Received: by mail-lf1-f43.google.com with SMTP id a9so24399094lfk.11 for ; Tue, 19 Jul 2022 05:10:48 -0700 (PDT) X-Gm-Message-State: ictOBFluNyOFs2LkA9cyPwjQx1787277AA= X-Google-Smtp-Source: AGRyM1uXz9kIUKW+Jr9gmWDavyPH6Asasz3dOU8HBBX30ywfI8RjP5ho9FUfw6Ui569Fs+sbOl4n6A== X-Received: by 2002:a19:6b07:0:b0:489:c785:8dfc with SMTP id d7-20020a196b07000000b00489c7858dfcmr16172646lfa.268.1658232648068; Tue, 19 Jul 2022 05:10:48 -0700 (PDT) X-Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:47 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-devel] [edk2-platforms][PATCH 10/10] Ext4Pkg: Group descriptor size must be 4-byte aligned Date: Tue, 19 Jul 2022 18:10:16 +0600 Message-Id: <20220719121016.29380-11-savvamtr@gmail.com> In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,savvamtr@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658424093; bh=YVOs1PFOvzqTU9nHG6YmXNO8Ie+r2PjkxLRtl1uWOKc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=JLjZZ9kaagSbOR52Nq1skdqXrdxgvitbRF1R3WiIc5emTl7r2i4Argt2POmAO45/RQg FXr8ymKy6bb3+uCSvfUXP3MLEZcCcOcMszcPfT7AF8/GLjxa4nmhXNkQtLK2Nr1IorWS/ w64ld1AjWbwdR/gPhO/ZuRJA20GoKPaFJCU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658424095454100030 Content-Type: text/plain; charset="utf-8" Adds 4-byte aligned check for superblock group descriptor size field Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Directory.c | 2 +- Features/Ext4Pkg/Ext4Dxe/Superblock.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Directory.c b/Features/Ext4Pkg/Ext4Dx= e/Directory.c index d1038c04926e..4441e6d192b6 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Directory.c +++ b/Features/Ext4Pkg/Ext4Dxe/Directory.c @@ -74,7 +74,7 @@ Ext4ValidDirent ( } =20 // Dirent sizes need to be 4 byte aligned - if (Dirent->rec_len % 4) { + if ((Dirent->rec_len % 4) !=3D 0) { return FALSE; } =20 diff --git a/Features/Ext4Pkg/Ext4Dxe/Superblock.c b/Features/Ext4Pkg/Ext4D= xe/Superblock.c index 42762b6aa780..3bf2e3001f26 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Superblock.c +++ b/Features/Ext4Pkg/Ext4Dxe/Superblock.c @@ -257,16 +257,16 @@ Ext4OpenSuperblock ( )); =20 if (EXT4_IS_64_BIT (Partition)) { + // s_desc_size should be 4 byte aligned and + // 64 bit filesystems need DescSize to be 64 bytes + if (((Sb->s_desc_size % 4) !=3D 0) || (Sb->s_desc_size < EXT4_64BIT_BL= OCK_DESC_SIZE)) { + return EFI_VOLUME_CORRUPTED; + } Partition->DescSize =3D Sb->s_desc_size; } else { Partition->DescSize =3D EXT4_OLD_BLOCK_DESC_SIZE; } =20 - if ((Partition->DescSize < EXT4_64BIT_BLOCK_DESC_SIZE) && EXT4_IS_64_BIT= (Partition)) { - // 64 bit filesystems need DescSize to be 64 bytes - return EFI_VOLUME_CORRUPTED; - } - if (!Ext4VerifySuperblockChecksum (Partition, Sb)) { DEBUG ((DEBUG_ERROR, "[ext4] Bad superblock checksum %lx\n", Ext4Calcu= lateSuperblockChecksum (Partition, Sb))); return EFI_VOLUME_CORRUPTED; --=20 2.37.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91656): https://edk2.groups.io/g/devel/message/91656 Mute This Topic: https://groups.io/mt/92531472/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-