sysprof/0002-libsysprof-elf-do-not-allow-setting-self-as-debug-li.patch
Christian Hergert f3ac1f58a2 update patches to sysprof-el10 branch
We now have a branch upstream for tracking el10 patches which makes this
a lot easier to maintain. This updates to using that branch as a diff
upon 47.1.

Resolves: RHEL-65743
2024-11-13 16:29:35 -08:00

29 lines
1.1 KiB
Diff

From c7910ee7b9f8d2b15f0b05f33e2280e3861ba9fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
Date: Wed, 9 Oct 2024 15:29:59 +0200
Subject: [PATCH 02/31] libsysprof: elf: do not allow setting self as debug
link
That will cause infinite recursion in `sysprof_elf_get_symbol_at_address_internal()`.
Also note that loops are still possible, this change
only prevents one way of creating loops.
---
src/libsysprof/sysprof-elf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/libsysprof/sysprof-elf.c b/src/libsysprof/sysprof-elf.c
index f4e5f914..0534eccb 100644
--- a/src/libsysprof/sysprof-elf.c
+++ b/src/libsysprof/sysprof-elf.c
@@ -502,6 +502,7 @@ sysprof_elf_set_debug_link_elf (SysprofElf *self,
{
g_return_if_fail (SYSPROF_IS_ELF (self));
g_return_if_fail (!debug_link_elf || SYSPROF_IS_ELF (debug_link_elf));
+ g_return_if_fail (debug_link_elf != self);
if (g_set_object (&self->debug_link_elf, debug_link_elf))
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEBUG_LINK_ELF]);
--
2.45.2