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


Groups > linux.kernel > #1473074

Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall

From Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall
Date 2016-08-31 09:20 +0200
Message-ID <sc7Yt-7LL-7@gated-at.bofh.it> (permalink)
References (8 earlier) <sbZoe-2i7-5@gated-at.bofh.it> <sbZoe-2i7-21@gated-at.bofh.it> <sbZRg-2t6-51@gated-at.bofh.it> <sc0kh-2Sd-5@gated-at.bofh.it> <sc0DE-30k-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 31.08.2016 01:28, Steven Rostedt wrote:
> On Tue, 30 Aug 2016 16:09:04 -0700
> Andy Lutomirski <luto@amacapital.net> wrote:
>
>> But none of this should be a problem at all for MIPS, right?  AFAICT
>> the only problem for MIPS is that there *is* a mapping from metadata
>> to nr.  If that mapping got removed, MIPS should just work, right?
>
> Wait, where's the mapping of metadata to nr. I don't see that, nor do I
> see a need for that. The issue is that we have metadata that expresses
> how to record a syscall, and we map syscall nr to metadata, because
> when tracing is active, the only thing we have to find that metadata is
> the syscall nr.
>
> Now if a syscall nr has more than one way to record (a single nr for
> multiple syscalls), then we get into trouble. That's why we have
> trouble with compat syscalls. The same number maps to different
> syscalls, and we don't know how to differentiate that.

Generally it looks like the MIPS case is more simple than other arches - 
as the syscall numbers for different ABIs are not overlapping, so when 
trying to get syscall metadata the number is sufficient.
It's just a case that the current code doesn't handle correctly (and 
just to makes things worse, while the compat syscalls are not supported 
at the moment for any arch, because of how the syscalls are numbered, 
tracing for native 64-bit code is currently broken).

But I agree with all the earlier comments that the current solution 
isn't very nice - and even though my patch would solve the issue for 
MIPS, all the existing issues would still remain elsewhere.


>>
>> For x86 compat, I think that adding arch should be sufficient.
>> Specifically, rather than having just one enter_syscall_files array,
>> have one per audit arch.  Then call syscall_get_arch() as well as
>> syscall_get_nr() and use both to lookup the metadata.  AFAIK this
>> should work on all architectures, although you might need some arch
>> helpers to enumerate all the arches and their respective syscall
>> tables (and max syscall nrs).
>
> OK, if the regs can get us to the arch, then this might work.
>
> That is, perhaps we can have multiple tables (not really sure how to
> make that happen in an arch agnostic way), and then have two functions:
>
> trace_get_syscall_nr(current, regs)
> trace_get_syscall_arch(current, regs)
>
> Although, that "arch" may be confusing.
>
> -- Steve
>

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


Thread

[PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Marcin Nowakowski <marcin.nowakowski@imgtec.com> - 2016-08-29 11:40 +0200
  Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Andy Lutomirski <luto@amacapital.net> - 2016-08-30 02:00 +0200
    Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per  syscall Marcin Nowakowski <marcin.nowakowski@imgtec.com> - 2016-08-30 10:20 +0200
      Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Andy Lutomirski <luto@amacapital.net> - 2016-08-30 21:00 +0200
        Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers  per syscall Steven Rostedt <rostedt@goodmis.org> - 2016-08-30 21:40 +0200
          Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Andy Lutomirski <luto@amacapital.net> - 2016-08-30 22:00 +0200
            Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers  per syscall Steven Rostedt <rostedt@goodmis.org> - 2016-08-30 23:00 +0200
              Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Andy Lutomirski <luto@amacapital.net> - 2016-08-30 23:50 +0200
                Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers  per syscall Steven Rostedt <rostedt@goodmis.org> - 2016-08-31 00:10 +0200
                Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Andy Lutomirski <luto@amacapital.net> - 2016-08-31 00:10 +0200
                Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers  per syscall Steven Rostedt <rostedt@goodmis.org> - 2016-08-31 00:40 +0200
                Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Andy Lutomirski <luto@amacapital.net> - 2016-08-31 01:10 +0200
                Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers  per syscall Steven Rostedt <rostedt@goodmis.org> - 2016-08-31 01:30 +0200
                Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Andy Lutomirski <luto@amacapital.net> - 2016-08-31 02:10 +0200
                Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per  syscall Marcin Nowakowski <marcin.nowakowski@imgtec.com> - 2016-08-31 16:10 +0200
                Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per  syscall Marcin Nowakowski <marcin.nowakowski@imgtec.com> - 2016-08-31 09:20 +0200
            Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Arnd Bergmann <arnd@arndb.de> - 2016-08-31 10:30 +0200
              Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers  per syscall Steven Rostedt <rostedt@goodmis.org> - 2016-09-01 17:30 +0200

csiph-web