e6b8f35
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
e6b8f35
From: Laszlo Ersek <lersek@redhat.com>
e6b8f35
Date: Fri, 7 Apr 2023 14:54:35 +0200
e6b8f35
Subject: [PATCH] grub_dl_set_mem_attrs(): fix format string
e6b8f35
e6b8f35
The grub_dprintf() call for printing the message
e6b8f35
e6b8f35
  updating attributes for GOT and trampolines
e6b8f35
e6b8f35
passes the argument "mod->name", but the format string doesn't accept that
e6b8f35
argument.
e6b8f35
e6b8f35
Print the module name too.
e6b8f35
e6b8f35
Example output:
e6b8f35
e6b8f35
> kern/dl.c:736: updating attributes for GOT and trampolines ("video_fb")
e6b8f35
e6b8f35
Fixes: ad1b904d325b (nx: set page permissions for loaded modules.)
e6b8f35
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
e6b8f35
---
e6b8f35
 grub-core/kern/dl.c | 3 ++-
e6b8f35
 1 file changed, 2 insertions(+), 1 deletion(-)
e6b8f35
e6b8f35
diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
e6b8f35
index ab9101a5ad..a97f4a8b13 100644
e6b8f35
--- a/grub-core/kern/dl.c
e6b8f35
+++ b/grub-core/kern/dl.c
e6b8f35
@@ -733,7 +733,8 @@ grub_dl_set_mem_attrs (grub_dl_t mod, void *ehdr)
e6b8f35
     {
e6b8f35
       tgsz = ALIGN_UP(tgsz, arch_addralign);
e6b8f35
 
e6b8f35
-      grub_dprintf ("modules", "updating attributes for GOT and trampolines\n",
e6b8f35
+      grub_dprintf ("modules",
e6b8f35
+		    "updating attributes for GOT and trampolines (\"%s\")\n",
e6b8f35
 		    mod->name);
e6b8f35
       grub_update_mem_attrs (tgaddr, tgsz, GRUB_MEM_ATTR_R|GRUB_MEM_ATTR_X,
e6b8f35
 			     GRUB_MEM_ATTR_W);