From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.8446.1672906295046000257 for ; Thu, 05 Jan 2023 00:11:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gaU9vq9f; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672906294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oCfnsW2A1k6fLprwkseOz7y63ot71RFlfetYWwGft54=; b=gaU9vq9fb1dA51KAEwqKNMBaNPEmo2OxRmdQr2fl+KCV7b0asODKy4/mXzc8ykZujNo8zS V5x8YsX8x278zo1nxYvPjEtn9hsSiDs9CPyAVHe68yZ8QKPkFSGCdEMCE4OwMlnpSiV9Jw 08lk+Btlw4ic1INvGqwcGdjhTovPMuo= Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-629-YqTVR6ajNBWXCZaYx7tgOw-1; Thu, 05 Jan 2023 03:11:30 -0500 X-MC-Unique: YqTVR6ajNBWXCZaYx7tgOw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CC75338123AB; Thu, 5 Jan 2023 08:11:29 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.238]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 003D41121314; Thu, 5 Jan 2023 08:11:28 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7EAFD180062D; Thu, 5 Jan 2023 09:11:27 +0100 (CET) Date: Thu, 5 Jan 2023 09:11:27 +0100 From: "Gerd Hoffmann" To: Alexander Graf Cc: Ard Biesheuvel , dann frazier , devel@edk2.groups.io, Leif Lindholm Subject: Re: [edk2-devel] [PATCH v3 03/16] ArmVirtPkg: make EFI_LOADER_DATA non-executable Message-ID: <20230105081127.muckhpcw6agfkfrs@sirius.home.kraxel.org> References: <20220926082511.2110797-1-ardb@kernel.org> <20220926082511.2110797-4-ardb@kernel.org> <20221128154610.wik3f65bhbfrdpva@sirius.home.kraxel.org> <7bba7344-fc37-abde-a792-5ae40621c70f@csgraf.de> <7676bbf9-23a5-5236-c811-fb3e00ac0675@csgraf.de> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi, > To clarify, I mean something like the patch below, but with an additional > callback notification similar to the Emu one in LoadImage(), so that we can > make sure we only enable the quirk when we load a known-bad grub binary. > That way we still force distros to ship fixed versions of their code, but > enable old code to continue running. > +  /* TODO: Only run this as part of a notify callback in ImageLoad() when > we > +           load a grub binary with a known-broken hash */ > +  BOOLEAN is_broken_grub = TRUE; > +  if (is_broken_grub) { > +    RealAllocatePages = gBS->AllocatePages; > +    gBS->AllocatePages = AllocatePagesForceLoaderCode; > +  } You left out the hard part, which is the list of hashes. And I suspect you underestimate the number of broken grub binaries in the wild ... take care, Gerd