Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1j6ZHy-0003tW-BS for mharc-grub-devel@gnu.org; Tue, 25 Feb 2020 07:26:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55555) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6ZHv-0003nR-1s for grub-devel@gnu.org; Tue, 25 Feb 2020 07:26:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6ZHs-0006WF-U6 for grub-devel@gnu.org; Tue, 25 Feb 2020 07:26:10 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26736 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6ZHs-0006Vf-QT for grub-devel@gnu.org; Tue, 25 Feb 2020 07:26:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582633567; 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=Xo6v0wJlRKAymsFi63PQNoq+oqZyWasAAlzIIlDu++Y=; b=KMHGfgFJtsEVK3I1CSnBwt5wvJ6nHGEOCZhilLaoTxu+0Cmz77i50KhrGjJZV+IQmJa5dF vftBZ0gUJmDpc7PjNcKRq19PMtDkGstE/iyAPWZZxGl0Fn7TO3pbRPAMfkAel63f0Sr6vf RNKSWSqcUHpdtXfodGoldylOTkHSr/w= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-zmn-GbZGNP6KdGSeB6EMIg-1; Tue, 25 Feb 2020 07:26:06 -0500 X-MC-Unique: zmn-GbZGNP6KdGSeB6EMIg-1 Received: by mail-wr1-f70.google.com with SMTP id 90so7223147wrq.6 for ; Tue, 25 Feb 2020 04:26:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CvCKpcI2ZBnzqM/KArrFTbxXJQOoblp00zrf/+WQJA4=; b=h+4feYD7QoB5fIldDy+JxGQU3IF6IlZjzMpDHsQ4NggmaqDBSsixxjwAObR9EP2Ll+ sfgUmBRIqCXeO712qcCeN45/QP/u/sYTYuTGh9Yjxu6gjQKq6BXAEXNmbgKJGUNfkNpo XC3TvrR4TXcZbJXEBV/EZmNDnwmsCH7oCEeWwrVO3kXa5w4HceBor9GLSbfaDZi2/E9t Om1SyFpH1QHj30Irpxtfm9m+ikl49L97Ptx99AnSEhimjbtRBfthNUJvmH6dch3YHBEd C/qEmUvuGcs9/Tf/D5sFcsHKsjZra2RLeYpZDCEFrGXg7/92fgjsO6l6jKMzVMLZ4WGK J7vA== X-Gm-Message-State: APjAAAVznFOQgbPAnfrTx7V7kGmIFq8DiILFUDxrQs27YEZCbHRK0RFX SxrpgoyJbpjV0VzEFW9szb2GQKvqkVQ6AcIIVvEmGPtQYD1ozPWViWZ6Nv+cOEfxLoMkTGa1CWP uPFpXa981W1c= X-Received: by 2002:adf:c54e:: with SMTP id s14mr70352130wrf.385.1582633564892; Tue, 25 Feb 2020 04:26:04 -0800 (PST) X-Google-Smtp-Source: APXvYqyQ5L2EXpDwo2oP+BJ/t8MlhUu9JE1auznlI1UtP0aJiWKibaK7UXHIARj+1fwBwAe42AG5IA== X-Received: by 2002:adf:c54e:: with SMTP id s14mr70352104wrf.385.1582633564670; Tue, 25 Feb 2020 04:26:04 -0800 (PST) Received: from minerva.redhat.com ([2a01:c50f:ab80:6700:527f:85b3:5615:ff0b]) by smtp.gmail.com with ESMTPSA id q6sm17251653wrf.67.2020.02.25.04.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 04:26:03 -0800 (PST) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Daniel Kiper , Peter Jones , Javier Martinez Canillas Subject: [PATCH 02/10] efi: Print more debug info in our module loader Date: Tue, 25 Feb 2020 13:25:45 +0100 Message-Id: <20200225122553.1120216-3-javierm@redhat.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200225122553.1120216-1-javierm@redhat.com> References: <20200225122553.1120216-1-javierm@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2020 12:26:13 -0000 From: Peter Jones The function that searches the mods section base address does not have any debug information. Add some debugging outputs that could be useful. Signed-off-by: Peter Jones Signed-off-by: Javier Martinez Canillas --- grub-core/kern/efi/efi.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c index 6e1ceb90516..3a708ed7215 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -308,13 +308,23 @@ grub_efi_modules_addr (void) } =20 if (i =3D=3D coff_header->num_sections) - return 0; + { + grub_dprintf("sections", "section %d is last section; invalid.\n", i= ); + return 0; + } =20 info =3D (struct grub_module_info *) ((char *) image->image_base =09=09=09=09 + section->virtual_address); - if (info->magic !=3D GRUB_MODULE_MAGIC) - return 0; + if (section->name[0] !=3D '.' && info->magic !=3D GRUB_MODULE_MAGIC) + { + grub_dprintf("sections", +=09=09 "section %d has bad magic %08x, should be %08x\n", +=09=09 i, info->magic, GRUB_MODULE_MAGIC); + return 0; + } =20 + grub_dprintf("sections", "returning section info for section %d: \"%s\"\= n", +=09 i, section->name); return (grub_addr_t) info; } =20 --=20 2.24.1