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


Groups > linux.kernel > #1449656

Re: [PATCH v3 1/3] x86/ptrace: Stop setting TS_COMPAT in ptrace code

Path csiph.com!news.freedyn.net!aioe.org!bofh.it!news.nic.it!robomod
From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: [PATCH v3 1/3] x86/ptrace: Stop setting TS_COMPAT in ptrace code
Date Mon, 25 Jul 2016 19:00:01 +0200
Message-ID <rYRot-6Xf-1@gated-at.bofh.it> (permalink)
References <rMhqp-6JS-3@gated-at.bofh.it> <rMhqp-6JS-9@gated-at.bofh.it> <rYwDn-2Sx-11@gated-at.bofh.it> <rYHIt-1cB-5@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VbhPDpuPUfi9kHY1DiWUlgDv1D3x4Qnzr3x4VYhHiDw=; b=j7Exo5jUP4syikAUcMlmqWlRRO9qgemU/4ewnbZEzhpqb/hwJkrA/Xug+MrPXEPFXG 7Bup9ff+dC7CZxmSP3x+bBN1CAMvFqOFI5j9aK+8fGPWvtTYQ4ppeq/iI/mngop1HeEB GXpBbkzeg/2IOpAN5WYZZX14T3MVtL3EwS7E3odWlRj6b/IEB9/m/LZoc91nPlKQgBt2 Hr4bigfa9uJjGz3toyjpUqvz21qomOxXdhyFBhOs4uod6fjU/rJ3h2c964zxUpXWkRoX xrhFvq3YdoACMLhMwZYl/BE/u6rwA2X679tMutYB/sJjjL7rEyWRR8DA8a8x+vxNgeMC PnCA==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VbhPDpuPUfi9kHY1DiWUlgDv1D3x4Qnzr3x4VYhHiDw=; b=UhtdlVCmNXFJHKg/mOJdQJE4uBhJY21/s3e9oXR+DrOKXHMtQ8kvbgkcuWy6xxbsSA rnd6oU5tmvJrKd+RCuTl/p+9c1P5hBA0Yio9z3w86mOu5jnxxhjJAZK6SaIl7PKdD+9h GQwe6qDdO1pTytv9CnqQjx9HI5rGfniFaRi8zVsOMIZaJdgxIzgIs7JsmwvRCdLFvTqw GMJVNG2zhcjGob4Hb2JvXL7/a662tM4C28+/16Uf3NL6MDYwwyPX0AtOzr5ykH0VO7qI AFMocPLdcRx0SIRQxkn/nMhWunfYcpTxipjoaepV/6k/hYjeZQBOyhZGjRqHrjSr3BGC 9SFg==
X-Gm-Message-State AEkoousNzGh9je9KlZF6W6a9JfzKUumjU6ga+GaBlw+zQNkTqk8gGZHC6xdhL6YgA348gyUbvgXVQ0pGv9oxbUH6
X-Received by 10.31.33.3 with SMTP id h3mr9320982vkh.59.1469465875465; Mon, 25 Jul 2016 09:57:55 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
X-Original-Cc Pedro Alves <palves@redhat.com>, Oleg Nesterov <oleg@redhat.com>, Kees Cook <keescook@chromium.org>, Borislav Petkov <bp@alien8.de>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, X86 ML <x86@kernel.org>
X-Original-Date Mon, 25 Jul 2016 09:57:36 -0700
X-Original-Message-ID <CALCETrX5en4p1vGQkxHc1=LZG4nvTfJSrTTMPyZwpZYhntTXTw@mail.gmail.com>
X-Original-References <cover.1466464928.git.luto@kernel.org> <8bacd629dcdbb97ee0626912c27a4a09f991b5dd.1466464928.git.luto@kernel.org> <CALCETrX=c=5=bJATY8s3ZxqkS3nf81O8gf7ta-f_hbBZFG0TUw@mail.gmail.com> <20160725063825.GB12474@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1449656

Show key headers only | View raw


On Jul 24, 2016 11:38 PM, "Ingo Molnar" <mingo@kernel.org> wrote:
>
>
> * Andy Lutomirski <luto@amacapital.net> wrote:
>
> > On Mon, Jun 20, 2016 at 4:39 PM, Andy Lutomirski <luto@kernel.org> wrote:
> > > Setting TS_COMPAT in ptrace is wrong: if we happen to do it during
> > > syscall entry, then we'll confuse seccomp and audit.  (The former
> > > isn't a security problem: seccomp is currently entirely insecure if a
> > > malicious ptracer is attached.)  As a minimal fix, this patch adds a
> > > new flag TS_I386_REGS_POKED that handles the ptrace special case.
> >
> > Hi Ingo-
> >
> > Could you apply this one patch for 4.8?  While I don't think it's a
> > significant security issue in 4.7 or earlier, leaving it unfixed in
> > 4.8 will introduce a potentially unpleasant interaction with some
> > seccomp changes that are queued up in the
> > security tree for 4.8.
> >
> > It will have a trivially-resolvable conflict with -mm.
> >
> > The rest of the series this is in can wait.
>
> I don't mind the rest of the series either - could you please repost it (with the
> review feedback addressed)?

I'm nervous about it for a couple reasons involving the fact that it's
user visible.

1. It doesn't make gdb work right in all the cases that gdb currently
gets wrong.  I haven't had time to think about whether there's a
minimal tweak that would fix this.

2. It might have annoying interactions with seccomp whitelists.  I
don't know that for sure, but I still don't love it.


Patch 1 is only user-visible in the case where the current behavior is
clearly wrong, so I'd personally be more comfortable applying just
patch 1 for 4.8.

--Andy

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


Thread

Re: [PATCH v3 1/3] x86/ptrace: Stop setting TS_COMPAT in ptrace code Andy Lutomirski <luto@amacapital.net> - 2016-07-24 20:50 +0200
  Re: [PATCH v3 1/3] x86/ptrace: Stop setting TS_COMPAT in ptrace code Ingo Molnar <mingo@kernel.org> - 2016-07-25 08:40 +0200
    Re: [PATCH v3 1/3] x86/ptrace: Stop setting TS_COMPAT in ptrace code Oleg Nesterov <oleg@redhat.com> - 2016-07-25 18:40 +0200
    Re: [PATCH v3 1/3] x86/ptrace: Stop setting TS_COMPAT in ptrace code Andy Lutomirski <luto@amacapital.net> - 2016-07-25 19:00 +0200
      Re: [PATCH v3 1/3] x86/ptrace: Stop setting TS_COMPAT in ptrace code Andy Lutomirski <luto@amacapital.net> - 2016-07-26 02:30 +0200

csiph-web