From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.zytor.com (terminus.zytor.com [65.50.211.136]) (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 A10CE21ECCB2E for ; Wed, 20 Sep 2017 11:16:14 -0700 (PDT) Received: from localhost.localdomain ([IPv6:2804:7f4:c480:6dab:0:0:0:3]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id v8KIH22s011624 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 20 Sep 2017 11:17:04 -0700 From: Paulo Alcantara To: edk2-devel@lists.01.org Cc: Paulo Alcantara , Michael D Kinney , Liming Gao , Laszlo Ersek , Ruiyu Ni , Star Zeng , Jiewen Yao Date: Wed, 20 Sep 2017 15:16:21 -0300 Message-Id: X-Mailer: git-send-email 2.11.0 Subject: [PATCH v3 0/2] UDF partition driver fix X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2017 18:16:14 -0000 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=707 Hi, This patchset fixes a bug in Partition driver that created UDF logical partitions by using entire block device space and thus polluting protocol database with broken handles. v1->v2: - Followed Laszlo's suggestions to submit a proper patchset. Thanks! - As I'm still waiting for Ruiyu and Star to test this fix, I took advantage of it and did some code cleanups :-) v2->v3: - Followed Ruiyu's suggestions to improve code and add additional checks for ensuring a valid UDF file system and supported by current EDK2 UDF file system implementation. Also run Ecc.py to make sure the files I touched did not break EDK2 C Coding Style, as well as PatchCheck.py for mal-formed patches. I've had a chance to test these changes with my 32GiB USB stick and formatted it on Windows 10 with `format` command. The UDF revisions I tested (by specifying it with "/R:revision") were 1.02, 1.50, 2.00, 2.01 (default) and 2.50. They all worked except the 2.50 revision which adds a Type 2 (Metadata) Partition and it's not supported by current EDK2 UDF implementation -- which handles only Type 1 (Physical) Partitions. The UDF 2.60 revision I tested with the usual `sudo mkudffs -b 512 --media-type=hd /dev/sdX` command in Linux. Remember, the *officially* supported revision is 2.60, however all revisions use the same volume structures as defined by ECMA 167 specification, and they usually differ from each other by means of new optional features, so that's why all those revisions worked with this implementation. Well, at least this what I understood when looking at the specifications. Please correct me if I'm wrong. Please, test building these changes in toolchains other than GCC and make sure they don't break the world :-) Thanks! Paulo Repo: https://github.com/pcacjr/edk2.git Branch: udf-partition-fix-v3 Cc: Michael D Kinney Cc: Liming Gao Cc: Laszlo Ersek Cc: Ruiyu Ni Cc: Star Zeng Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Reported-by: Ruiyu Ni Signed-off-by: Paulo Alcantara --- Paulo Alcantara (2): MdePkg: Add UDF volume structure definitions MdeModulePkg/PartitionDxe: Fix creation of UDF logical partition MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c | 363 ++++++++++-- MdeModulePkg/Universal/Disk/UdfDxe/File.c | 16 +- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 627 ++++++++------------ MdeModulePkg/Universal/Disk/UdfDxe/Udf.c | 7 - MdeModulePkg/Universal/Disk/UdfDxe/Udf.h | 158 ++--- MdePkg/Include/IndustryStandard/Udf.h | 63 +- 6 files changed, 665 insertions(+), 569 deletions(-) -- 2.11.0