From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mx.groups.io with SMTP id smtpd.web12.39751.1658232633572089373 for ; Tue, 19 Jul 2022 05:10:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kLwKjj6E; spf=pass (domain: gmail.com, ip: 209.85.167.48, mailfrom: savvamtr@gmail.com) Received: by mail-lf1-f48.google.com with SMTP id z22so10779157lfu.7 for ; Tue, 19 Jul 2022 05:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KJVpxSQSpO4FW4cwPEaelaBPDXZZde6NJaWFuuUvabU=; b=kLwKjj6EY0VpCn5ISbRQjxoGDYeyhO1Y2oAWnLX0xKp+LljwRD5gtkSN35CqvvS1QX QGRi0LkELguK5kDbN1LbfX5pYk7tRngnZBw1uGwcbST2PnPkH3mNzUjxzji+8hASEpRw HroNwRhhyceJbLX6/MxSyQQCXd7jrid5K9FL3syCM9uBl2wjcy6B5DDY6X7p/1mMhOhF KynEdXm4XGGXg5AVXDBpYEmGJ6uEp0rr32017/ZR8UYnIOKU9Pd05TDboAvdCiOm7qwI IFZhQHAgGrgc9471x7K1GmSj0/wfDr3jGiVHWUCBiokswZKLHqtWz0qiNk7I8ynuXDb8 Q6Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KJVpxSQSpO4FW4cwPEaelaBPDXZZde6NJaWFuuUvabU=; b=H0KcYCRz+coEDKsph7eJ/rWvRxnu8B7vraeEBd22u5dHNwW7nShhRF0CjSTRcBkO38 5RGIZWAAE5goRsvzlLp3a4lvBWJzGpEz0UeSh2+0bszl55MLGzaidJ/BMHkcW40x+RXs q+o33FLLc9iSCs5T2A+CBiKf+ZMW8UmHV7OF3jM6qbfNZxQJrUjRSor0+RCgpsbRUPc5 VVsH8PvTsgij/z/fNC65A+6ekGedNTc5gaimvnI/+8lwhIUsfJoz0pJL8HCYmJ/3pnb7 mdxqh/cWsoB+v+vGVho4HYWEX9ELCwm32GQI3UxSyTKtyQqn7JQEwZttE3L4TclBOwO2 1erg== X-Gm-Message-State: AJIora8NGBTmYFylqT+yFmcCZLUtdwYmlA/2C4/0CvFafSYjsz59U3I2 TOSTGy1LeIIlVC9hEKTDQf2Bi4y/z84YZLkn4lU= X-Google-Smtp-Source: AGRyM1tc+YkNcqvvZpTe9C4lHsecqi3sZXgN3dLgLIqyV8mPYQlp7tcZ/nGzPW0gx6gMGDe4WK8LhA== X-Received: by 2002:a05:6512:3b9e:b0:489:ff28:2549 with SMTP id g30-20020a0565123b9e00b00489ff282549mr16732701lfv.23.1658232631369; Tue, 19 Jul 2022 05:10:31 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:30 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-platforms][PATCH 00/10] Ext4Pkg: Code security and correctness improvements Date: Tue, 19 Jul 2022 18:10:06 +0600 Message-Id: <20220719121016.29380-1-savvamtr@gmail.com> X-Mailer: git-send-email 2.37.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi all, This patchset attempts to improve security of code sections by fixing integer overflows, missing aligment checks, unsafe casts. Also I simplified some routines, fixed compiler warnings and corrected some code mistakes. REF: https://github.com/savvamitrofanov/edk2-platforms/commits/ext4pkg_security_improvements Cc: Marvin Häuser Cc: Pedro Falcato Cc: Vitaly Cheptsov Savva Mitrofanov (10): Ext4Pkg: Replace SetMem(,,0) with ZeroMem Ext4Pkg: Change HoleLen type to UINT64 Ext4Pkg: Use 32-bit block number in BlockMap Ext4Pkg: Use assertion in Ext4CalculateChecksum Ext4Pkg: Fix compiler warnings Ext4Pkg: Drop dir entry name_len limit extra check Ext4Pkg: Simplify Ext4RemoveDentry logic Ext4Pkg: Fix possible int overflow in Ext4ExtentsMapKeyCompare Ext4Pkg: Return bad block type in Ext4GetBlockpath Ext4Pkg: Group descriptor size must be 4-byte aligned Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h | 3 +- Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h | 2 +- Features/Ext4Pkg/Ext4Dxe/BlockMap.c | 18 ++++++++---- Features/Ext4Pkg/Ext4Dxe/Directory.c | 29 ++------------------ Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c | 10 ++++--- Features/Ext4Pkg/Ext4Dxe/Extents.c | 5 ++-- Features/Ext4Pkg/Ext4Dxe/Inode.c | 8 +++--- Features/Ext4Pkg/Ext4Dxe/Superblock.c | 12 ++++---- 8 files changed, 37 insertions(+), 50 deletions(-) -- 2.37.0