From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 9B37C941060 for ; Thu, 19 Oct 2023 06:29:12 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=8WTG2rjD+jGqZV+7c9ZeTH2EFlafaTfFQjKQ59D9arQ=; c=relaxed/simple; d=groups.io; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20140610; t=1697696951; v=1; b=w06vYfNmL8Cvrmuc0+sLw6uPcpSpy+EdHtliH/PdDJaD4b4GvGabT8Gti1Qwsduijj5XdQis kAsbHVW/HsLHZnEl9u0rnEDNrnOJL3zQvJGKVpuNTnquadq2yYjVjbhrp2CtDaDQKRLWhiJi0Ro u0g8wMuhFh8ZmOFGg69tlANc= X-Received: by 127.0.0.2 with SMTP id gXxLYY7687511xLhlJVlyONA; Wed, 18 Oct 2023 23:29:11 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.21674.1697696950496004314 for ; Wed, 18 Oct 2023 23:29:10 -0700 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-298-4h84DV1TMiyFUyE98Lh2Rw-1; Thu, 19 Oct 2023 02:28:41 -0400 X-MC-Unique: 4h84DV1TMiyFUyE98Lh2Rw-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8AD7E29AA38F; Thu, 19 Oct 2023 06:28:41 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.154]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 35CBA2166B26; Thu, 19 Oct 2023 06:28:41 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 64E6B1800936; Thu, 19 Oct 2023 08:28:35 +0200 (CEST) Date: Thu, 19 Oct 2023 08:28:35 +0200 From: "Gerd Hoffmann" To: Laszlo Ersek Cc: devel@edk2.groups.io, Ard Biesheuvel , Jiewen Yao , Jordan Justen Subject: Re: [edk2-devel] [PATCH] OvmfPkg/VirtioFsDxe: tolerate opening an abs. pathname rel. to a reg. file Message-ID: <3wcxiedm4dlq5sr4qhswrmdkfvtgapygev2vkwagrqla6oskqc@wzwffqbeaqej> References: <20231018172434.91280-1-lersek@redhat.com> MIME-Version: 1.0 In-Reply-To: <20231018172434.91280-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk 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,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: eNwvSyhS2g45KKAXYau7Iut5x7686176AA= Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=w06vYfNm; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Wed, Oct 18, 2023 at 07:24:34PM +0200, Laszlo Ersek wrote: > Referring to a file relative to a regular file makes no sense (or at least > it cannot be implemented consistently with how a file is referred to > relative to a directory). VirtioFsSimpleFileOpen() has enforced this > strictly since the beginning, and a few months ago I reported USWG Mantis > ticket #2367 [1] too, for clearing up the related confusion in the UEFI > spec. > > Unfortunately, the shim boot loader contains such a bug [2] [3]. I don't > believe the shim bug is ever going to be fixed. We can however relax the > check in VirtioFsSimpleFileOpen() a bit: if the pathname that's being > opened relative to a regular file is absolute, then the base file is going > to be ignored anyway, so we can let the caller's bug slide. This happens > to make shim work. > > Why this matters: UEFI-bootable Linux installer ISOs tend to come with > shim and grub in the embedded (ElTorito) FAT image (ESP). Sometimes you > want to build upstream shim/grub binaries, but boot the same ISO > otherwise. The fastest way for overriding the ESP for this purpose is to > copy its original contents to a virtio filesystem, then overwrite the shim > and grub binaries from the host side. Note that this is different from > direct-booting a kernel (via fw_cfg); the point is to check whether the > just-built shim and grub are able to boot the rest of the ISO. > > [1] https://mantis.uefi.org/mantis/view.php?id=2367 > [2] https://bugzilla.redhat.com/show_bug.cgi?id=1966973 > [3] https://github.com/rhboot/shim/issues/382 > > Cc: Ard Biesheuvel > Cc: Gerd Hoffmann > Cc: Jiewen Yao > Cc: Jordan Justen > Signed-off-by: Laszlo Ersek Reviewed-by: Gerd Hoffmann Tested-by: Gerd Hoffmann -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109795): https://edk2.groups.io/g/devel/message/109795 Mute This Topic: https://groups.io/mt/102044004/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-