Skip to content

Preserve syscall results during application invocation - #8024

Draft
rrnewton wants to merge 1 commit into
DynamoRIO:masterfrom
rrnewton:fix-invoke-syscall-result
Draft

Preserve syscall results during application invocation#8024
rrnewton wants to merge 1 commit into
DynamoRIO:masterfrom
rrnewton:fix-invoke-syscall-result

Conversation

@rrnewton

Copy link
Copy Markdown

dr_invoke_syscall_as_app() ran post_system_call() without first publishing the raw kernel return value in the saved machine context. Post-syscall handlers therefore observed the stale syscall-number register; for SYS_mmap on x86-64 this is 9 instead of the returned mapping address and can corrupt DynamoRIO memory bookkeeping or crash the guest.\n\nStore the raw return value before post_system_call(), then return the possibly adjusted result. Extend client.strace with an anonymous mmap/munmap invocation to exercise post-syscall memory bookkeeping.\n\nDownstream reproducer: a DynamoRIO client that forwards application mmap through dr_invoke_syscall_as_app caused /usr/bin/sort and /usr/bin/md5sum to SIGSEGV before guest output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant