https://sourceware.org/bugzilla/show_bug.cgi?id=34579

--- Comment #2 from Karan Kurani <karankurani3k at gmail dot com> ---
Yes, that's the sequence. The explicit free(stack) was just a lifetime probe to
test what a caller can assume after dwflst_sample_getframes() returns.

I don't have evidence that current eu-stackprof exercises this sequence, so I
agree this is primarily an API-lifetime/robustness question rather than a
current tool security issue.

My only reason for flagging it was that the header explicitly gives Elf an
extended lifetime requirement, but not stack/regs, and there isn't a detach
step exposed to the caller. If the intended contract is that those buffers
remain valid with the attached callbacks, documenting that seems reasonable. 

If re-entry is not intended, clearing the temporary callback state would also
make that explicit in behavior.

Happy to re-test whichever direction you and the other maintainers prefer.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to