Skip to contentSkip to conversation

efi: fix GetNextDevicePathInstance trace argument

PATCH Applied Ahmad Fatoum 2 participants 2 messages Jul 9 – Jul 10

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: fix GetNextDevicePathInstance trace argument

Verbose EFI tracing formats device paths with %pD. The GetNextDevicePathInstance wrapper receives an EFI_DEVICE_PATH **, but passed that pointer slot directly to %pD. When the SCT called the service, the trace formatter interpreted stack bytes as a device path and could loop before the service body was reached.

Log the pointed-to device path when the argument itself is present. This keeps the trace useful while avoiding a tracing-induced hang during the Device Path Utilities ACS coverage.

Assisted-by Codex:gpt-5.5
---
 efi/loader/protocols/device_path_utilities.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
efi/loader/protocols/device_path_utilities.c +2 -1
index ef88e2d647fb..8788149f6de4 100644
@@ -143,7 +143,8 @@ static struct efi_device_path * EFIAPI get_next_device_path_instance(
 	struct efi_device_path **device_path_instance,
 	efi_uintn_t *device_path_instance_size)
 {
-	EFI_ENTRY("%pD, %p", device_path_instance, device_path_instance_size);
+	EFI_ENTRY("%pD, %p", device_path_instance ? *device_path_instance : NULL,
+		  device_path_instance_size);
 	return EFI_EXIT(efi_dp_get_next_instance(device_path_instance,
 						 device_path_instance_size));
 }
Signature · 1 line
2.47.3
Applied
#1 lore raw
Quoted 11 lines · Ahmad Fatoum

Verbose EFI tracing formats device paths with %pD. The GetNextDevicePathInstance wrapper receives an EFI_DEVICE_PATH **, but passed that pointer slot directly to %pD. When the SCT called the service, the trace formatter interpreted stack bytes as a device path and could loop before the service body was reached.

Log the pointed-to device path when the argument itself is present. This keeps the trace useful while avoiding a tracing-induced hang during the Device Path Utilities ACS coverage.

[...]

Applied, thanks!

[1/1] efi: fix GetNextDevicePathInstance trace argument
https://git.pengutronix.de/cgit/barebox/commit/?id=294a67a596fb (link may not be stable)

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>