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


Groups > linux.kernel > #1207220

Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values wrong in VM?

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values wrong in VM?
Date 2015-08-14 01:00 +0200
Message-ID <pX9DA-q0-19@gated-at.bofh.it> (permalink)
References (5 earlier) <pX5JE-3dG-15@gated-at.bofh.it> <pX8oa-7bD-11@gated-at.bofh.it> <pX8xQ-7ln-21@gated-at.bofh.it> <pX9Dz-q0-7@gated-at.bofh.it> <pX9DA-q0-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 13, 2015 at 3:54 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Thu, Aug 13, 2015 at 3:49 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> Does the attached patch make sense and work?
>
> Btw, I'm not all that happy with it anyway.
>
> I still think Denys' patch also potentially changed what audit and
> strace see for %rax in the pt_regs to -ENOSYS, which I'm not convinced
> is a good change.

For better for for worse, the native 64-bit path changed several
versions agi, and nothing broke that I'm aware of.  The change was:

commit 54eea9957f5763dd1a2555d7e4cb53b4dd389cc6
Author: Andy Lutomirski <luto@amacapital.net>
Date:   Fri Sep 5 15:13:55 2014 -0700

    x86_64, entry: Treat regs->ax the same in fastpath and slowpath syscalls

AFAIK, ptrace has always seen ax == -ENOSYS on syscall entry for
native 64-bit syscalls.  My change just simplified the fast path
(which is invisible by ptrace for obvious reasons, unless someone
traces fork or something along those lines *without*) and made it less
different from the slow path.  (IIRC it also simplified some stuff
down the road.)

Looking at 3.19's ia32entry.S, it has:

sysenter_tracesys:
#ifdef CONFIG_AUDITSYSCALL
        testl   $(_TIF_WORK_SYSCALL_ENTRY &
~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
        jz      sysenter_auditsys
#endif
        SAVE_REST
        CLEAR_RREGS
        movq    $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */

So I think it's always been the intent and practice that ptracers
would see ax == -ENOSYS on syscall entry.

IOW, whether this is good or bad, I don't think it's really a change.

--Andy
--
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

[Regression v4.2 ?] 32-bit seccomp-BPF returned errno values wrong in VM? David Drysdale <drysdale@google.com> - 2015-08-13 10:40 +0200
  Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Denys Vlasenko <dvlasenk@redhat.com> - 2015-08-13 17:20 +0200
    Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? David Drysdale <drysdale@google.com> - 2015-08-13 18:30 +0200
      Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Andy Lutomirski <luto@amacapital.net> - 2015-08-13 19:20 +0200
        Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? David Drysdale <drysdale@google.com> - 2015-08-13 19:50 +0200
          Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Kees Cook <keescook@chromium.org> - 2015-08-13 20:50 +0200
            Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Denys Vlasenko <dvlasenk@redhat.com> - 2015-08-13 23:40 +0200
              Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Andy Lutomirski <luto@amacapital.net> - 2015-08-13 23:50 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Kees Cook <keescook@chromium.org> - 2015-08-14 01:00 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Andy Lutomirski <luto@amacapital.net> - 2015-08-14 01:10 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Kees Cook <keescook@chromium.org> - 2015-08-14 01:20 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Linus Torvalds <torvalds@linux-foundation.org> - 2015-08-14 01:40 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Denys Vlasenko <dvlasenk@redhat.com> - 2015-08-14 14:00 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Andy Lutomirski <luto@amacapital.net> - 2015-08-14 16:30 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? David Drysdale <drysdale@google.com> - 2015-08-14 09:40 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Linus Torvalds <torvalds@linux-foundation.org> - 2015-08-14 01:00 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Andy Lutomirski <luto@amacapital.net> - 2015-08-14 01:00 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Linus Torvalds <torvalds@linux-foundation.org> - 2015-08-14 01:30 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Linus Torvalds <torvalds@linux-foundation.org> - 2015-08-14 01:00 +0200
              Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Linus Torvalds <torvalds@linux-foundation.org> - 2015-08-14 00:30 +0200
                Re: [Regression v4.2 ?] 32-bit seccomp-BPF returned errno values  wrong in VM? Denys Vlasenko <dvlasenk@redhat.com> - 2015-08-14 13:30 +0200

csiph-web