7db423d6 | 10-Feb-2022 |
Mark Johnston <markj@FreeBSD.org> |
libctf: Rip out CTFv1 support
CTFv1 was obsolete before libctf was imported into FreeBSD, and ctfconvert/ctfmerge can emit only CTFv2. Make ctf.h a bit easier to maintain by ripping v1 support out.
libctf: Rip out CTFv1 support
CTFv1 was obsolete before libctf was imported into FreeBSD, and ctfconvert/ctfmerge can emit only CTFv2. Make ctf.h a bit easier to maintain by ripping v1 support out. No functional change intended.
MFC after: 1 week Sponsored by: The FreeBSD Foundation
show more ...
|
f810bf0e | 11-Mar-2015 |
Mark Johnston <markj@FreeBSD.org> |
When copying a type from a source CTF container to a destination container, ctf_add_type() first performs a by-name lookup of the type in the destination container. If this lookup returns a forward d
When copying a type from a source CTF container to a destination container, ctf_add_type() first performs a by-name lookup of the type in the destination container. If this lookup returns a forward declaration for an enum, struct, or union, reset dst_type back to CTF_ERR, indicating that the source type is not in fact present in the destination container. This ensures that ctf_add_type() will also search the destination container's dynamic type list for the source type.
Without this change, a pair of mutually recursive struct definitions could cause infinite recursion in ctf_add_type() if the destination container only contained forward declarations for the struct types: ctf_add_type() recursively calls itself on each struct member's type, and the forward declarations meant that the dynamic type list search would be skipped.
MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
show more ...
|
b0ee9129 | 10-Mar-2015 |
Mark Johnston <markj@FreeBSD.org> |
CTF containers use the ctf_dtoldid field as a threshold type index which indicates the range of type indices which have been committed to the container by ctf_update(). However, the top bit of the dt
CTF containers use the ctf_dtoldid field as a threshold type index which indicates the range of type indices which have been committed to the container by ctf_update(). However, the top bit of the dtd_type field is not part of the type index; rather, it is a flag used to indicate that the corresponding CTF container is a parent. This is why the maximum CTF type index is 2^15 - 1 rather than 2^16 - 1. Therefore, this flag must be masked off (using the CTF_TYPE_TO_INDEX macro) when comparing a type index with the ctf_dtoldid field of a container.
This bug was causing libctf to erroneously free committed type definitions in ctf_discard(). libdtrace holds some references to such types, resulting in a use-after-free.
MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
show more ...
|