This is an archive of the discontinued LLVM Phabricator instance.

[BPF] Fix Segfault in BTFDebug
AbandonedPublic

Authored by dave-tucker on Sep 23 2022, 7:12 AM.

Details

Summary

Found using bpf-linker after linking a binary with debuginfo with a
library with no debuginfo. In this case, auto *S may be NULL and
therefore S->getLine() can segfault.

Signed-off-by: Dave Tucker <datucker@redhat.com>

Event Timeline

dave-tucker created this revision.Sep 23 2022, 7:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2022, 7:12 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
dave-tucker requested review of this revision.Sep 23 2022, 7:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2022, 7:12 AM
ast added a comment.Sep 23 2022, 7:33 AM

looks fine, but could you add a unit test for it?

looks fine, but could you add a unit test for it?

i can if someone can point me to the unit tests for this class as i'm not familiar with the codebase.

looks fine, but could you add a unit test for it?

i can if someone can point me to the unit tests for this class as i'm not familiar with the codebase.

Could you please describe a minimal example?
I can wrap it as a test script in the llvm/test/CodeGen/BPF/.

dave-tucker abandoned this revision.Aug 2 2023, 1:08 PM

Abandoned in favour of D156446