]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdw/libdw_findcu.c: Fix TOCTOU race condition in __libdw_findcu
authorAaron Merey <amerey@redhat.com>
Thu, 27 Mar 2025 03:35:47 +0000 (23:35 -0400)
committerAaron Merey <amerey@redhat.com>
Thu, 27 Mar 2025 04:02:58 +0000 (00:02 -0400)
commit31883ca665354baca6efff5a8f4f95616acf05b3
treef334933296f190f0ee86b7a2b0d8028b5c748598
parent5bde5c7f8ba7fe829cf5666f5194329f4e61f928
libdw/libdw_findcu.c: Fix TOCTOU race condition in __libdw_findcu

Ensure that dwarf_lock is held before accessing next_tu_offset and
next_cu_offset.

This fixes a TOCTOU bug in __libdw_findcu that causes NULL to be
incorrectly returned.

Signed-off-by: Aaron Merey <amerey@redhat.com>
libdw/libdw_findcu.c