<p></p>
<blockquote>
<p dir="auto">On Sun, Jan 23, 2022 at 02:49:27AM -0800, Huacai Chen wrote: I'm sorry that we still have to export orig_a0, because the current solution cannot let ptrace to modify arg0 and return value at the same time.<br>
What ptracers usually do is tampering with the syscall number and/or its arguments on entering syscall and tampering with the return value on exiting syscall. Tampering with the return value on entering syscall is not reliable as it is not supported by all linux architectures. That is, I don't see why the change is necessary.</p>
</blockquote>
<p dir="auto">Could you please see tools/testing/selftests/seccomp/seccomp_bpf.c in kernel? TRACE_syscall.ptrace.syscall_errno and TRACE_syscall.ptrace.syscall_faked fails with the current solution.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/strace/strace/pull/205#issuecomment-1019480720">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AOVBTR3C4VF543WFWGSIMNTUXP343ANCNFSM5KYUVD5Q">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AOVBTRZMDHOHB5XVLAUKW6TUXP343A5CNFSM5KYUVD52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHTCAVEA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><strace/strace/pull/205/c1019480720</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/strace/strace/pull/205#issuecomment-1019480720",
"url": "https://github.com/strace/strace/pull/205#issuecomment-1019480720",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>