Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1265782

Re: Compat syscall instrumentation and return from execve issue

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: Compat syscall instrumentation and return from execve issue
Date 2015-11-09 17:10 +0100
Message-ID <qsXb4-dY-23@gated-at.bofh.it> (permalink)
References <qsDYK-4kU-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, 8 Nov 2015 19:37:37 +0000 (UTC)
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:

> I have a few ideas on how to overcome this, and would like your
> feedback on the matter:
> 
> 1) One possible approach would be to reserve an extra status flag
>    in struct thread_info to get the TS_COMPAT status at syscall
>    entry. It would _not_ be updated when the executable is loaded,
>    so the state at return from execve would match the state when
>    entering execve. This is a simple approach, but requires kernel
>    changes.

Or add a flag TS_EXECVE that can be set by the tracepoint syscall
enter, and checked on exit. If set, we know that the exec happened.

> 
> 2) Keep the compat state at system call entry in a data structure
>    (e.g. hash table) indexed by thread number within each tracer.
>    This could work around this issue within each tracer.

This is of course what you can do now. As it doesn't touch the kernel.

> 
> 3) Change the syscall number in the struct pt_regs whenever we
>    change the compat mode of a process. A 64-bit execve system
>    call number would be mapped to a 32-bit compat execve number,
>    or the opposite. This requires a kernel change, and seems to be
>    rather intrusive.
> 

This is a definite no.


I'm thinking the TS_EXECVE flag would be the least intrusive. Add a
comment that it is used by tracepoints to map between compat and
non-compat syscalls when execve switches the flag. This would not need
to touch any of the logic of the hotpaths within the systemcalls
themselves.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Compat syscall instrumentation and return from execve issue Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2015-11-08 20:40 +0100
  Re: Compat syscall instrumentation and return from execve issue Steven Rostedt <rostedt@goodmis.org> - 2015-11-09 17:10 +0100
    Re: Compat syscall instrumentation and return from execve issue Andy Lutomirski <luto@kernel.org> - 2015-11-09 20:30 +0100
      Re: Compat syscall instrumentation and return from execve issue Steven Rostedt <rostedt@goodmis.org> - 2015-11-09 20:50 +0100
        Re: Compat syscall instrumentation and return from execve issue Andy Lutomirski <luto@amacapital.net> - 2015-11-09 22:00 +0100
          Re: Compat syscall instrumentation and return from execve issue Steven Rostedt <rostedt@goodmis.org> - 2015-11-09 22:20 +0100
            Re: Compat syscall instrumentation and return from execve issue Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2015-11-10 02:40 +0100
            Re: Compat syscall instrumentation and return from execve issue Andy Lutomirski <luto@amacapital.net> - 2015-11-10 03:00 +0100
              Re: Compat syscall instrumentation and return from execve issue Steven Rostedt <rostedt@goodmis.org> - 2015-11-10 03:40 +0100
                Re: Compat syscall instrumentation and return from execve issue Andy Lutomirski <luto@amacapital.net> - 2015-11-12 02:10 +0100

csiph-web