Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1600007
| From | "Dmitry V. Levin" <ldv@altlinux.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: Compat 32-bit syscall entry from 64-bit task!? |
| Date | 2017-03-14 04:00 +0100 |
| Message-ID | <tkKQO-1VS-13@gated-at.bofh.it> (permalink) |
| References | (3 earlier) <inmal-2Rz-3@gated-at.bofh.it> <inovv-6H7-9@gated-at.bofh.it> <inBVL-4wm-5@gated-at.bofh.it> <tiTER-5f2-1@gated-at.bofh.it> <tiYbv-8nc-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Wed, Mar 08, 2017 at 08:39:55PM -0800, Andrew Lutomirski wrote:
> On Wed, Mar 8, 2017 at 3:41 PM, Dmitry V. Levin wrote:
[...]
> > Is there any progress with this (or any alternative) solution?
> >
> > I see the kernel side has changed a bit, and the strace part
> > is in a better shape than 5 years ago (although I'm biased of course),
> > but I don't see any kernel interface that would allow strace to reliably
> > recognize this 0x80 case.
>
> I am strongly opposed to fudging registers to half-arsedly slightly
> improve the epicly crappy ptrace(2) interface for syscalls.
>
> To fix this right, please just add PTRACE_GET_SYSCALL_INFO or similar
> to, in one shot, read out all the syscall details. This means: arch,
> no, arg0..arg5, and *whether it's entry or exit*. I propose returning
> this structure:
>
> struct ptrace_syscall_info {
> u8 op; /* 0 for entry, 1 for exit */
> u8 pad0;
> u16 pad1;
> u32 pad2;
> union {
> struct seccomp_data syscall_entry;
> s64 syscall_exit_retval;
> };
> };
>
> because struct seccomp_data already gets this right. There's plenty
> of opportunity to fine-tune this. Now it works on all architectures.
Unfortunately, the API is missing.
Unlike syscall_get_nr(), syscall_get_arch() works with the current task
only so there is no API to get the arch identifier for the given task
that would work on all architectures.
--
ldv
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Compat 32-bit syscall entry from 64-bit task!? "Dmitry V. Levin" <ldv@altlinux.org> - 2017-03-09 01:00 +0100
Re: Compat 32-bit syscall entry from 64-bit task!? Andrew Lutomirski <luto@mit.edu> - 2017-03-09 05:50 +0100
Re: Compat 32-bit syscall entry from 64-bit task!? "Dmitry V. Levin" <ldv@altlinux.org> - 2017-03-14 04:00 +0100
csiph-web