DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.64k stars 560 forks source link

rt_sigprocmask not failing for bad address #5254

Open abhinav92003 opened 2 years ago

abhinav92003 commented 2 years ago

DR's handling of rt_sigprocmask doesn't fail even if a bad address is passed. handle_sigprocmask indeed checks whether the passed address is valid: https://github.com/DynamoRIO/dynamorio/blob/223213a2f254640cd1433a48cf0bebd20f828274/core/unix/signal.c#L2306, but it returns success anyway: https://github.com/DynamoRIO/dynamorio/blob/223213a2f254640cd1433a48cf0bebd20f828274/core/unix/os.c#L7349. This is causing an assertion to fail in a proprietary app.

abhinav92003 commented 2 years ago

Example code that uses this syscall to check whether a given address is valid: https://github.com/abseil/abseil-cpp/blob/master/absl/debugging/internal/address_is_readable.cc#L85

abhinav92003 commented 2 years ago

Keeping this open as there's still some work left on handling the TODOs added by #5255.