This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] always install signal handler with SA_ONSTACK
AcceptedPublic

Authored by randall77 on May 9 2023, 3:54 PM.

Details

Summary

SA_ONSTACK is required for certain runtimes that use small stacks, for instance the Go runtime.
See https://github.com/golang/go/issues/49075
SA_ONSTACK is a no-op unless someone also calls sigaltstack.

Diff Detail

Event Timeline

randall77 created this revision.May 9 2023, 3:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2023, 3:54 PM
Herald added a subscriber: Enna1. · View Herald Transcript
randall77 requested review of this revision.May 9 2023, 3:54 PM

Looks good to me in principle. I'm wondering whether there could be situations where a signal stack has been established with sigaltstack but it's intended for some specific signal(s) only - if we were to set SA_ONSTACK uncontitionally, we would run all of the fuzzer's signal handlers on the signal stack. That said, none of the handlers seem to require a lot of stack space, so it's probably fine.

I agree there is a possibility of a problem if signal handlers need more stack than provided by sigaltstack. That seems like a pretty hypothetical problem, however. In contrast, there is a current real problem with executing signals on user's stacks.

Ping. Can we get this in?

sebastianpoeplau accepted this revision.Oct 25 2023, 1:22 AM

Since nobody has objected thus far let's get it in. I don't know if approval from me is enough to be able to merge, but let's try...

This revision is now accepted and ready to land.Oct 25 2023, 1:22 AM

Is there something I need to do to actually get this landed?