[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUTJkGHWZ=3yKa-myVhKrNuoJhtingKv4B+YbUu5ZX=2g@mail.gmail.com>
Date: Mon, 20 Jun 2016 09:30:47 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Pedro Alves <pedro@...ves.net>, Kees Cook <keescook@...omium.org>,
Borislav Petkov <bp@...en8.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
X86 ML <x86@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] x86/ptrace: Remove questionable TS_COMPAT usage in ptrace
On Mon, Jun 20, 2016 at 8:24 AM, Oleg Nesterov <oleg@...hat.com> wrote:
> On 06/19, Andy Lutomirski wrote:
>>
>> On Sat, Jun 18, 2016 at 10:02 AM, Andy Lutomirski <luto@...capital.net> wrote:
>> Step 1: for 4.7 and for -stable, introduce TS_I386_REGS_POKED. Set it
>> in putreg32. Use it in syscall_get_error, get_nr_restart_syscall,
>> etc. Clear it in do_signal.
>
> do_signal() won't be necessarily called...
True. But I should have said "clear it in prepare_exit_to_usermode",
and the patch I'm just about to send does that.
>
>> I wonder if we could actually get away with doing syscall restart
>> processing before ptrace invocation.
>
> How? this doesn't look possible or I misunderstood.
>
> How about the simple change below for now? IIRC 32-bit task can't use
> "syscall" so if syscall_get_nr() >= 0 then even the wrong TS_COMPAT is
> not that bad, even if it "leaks" to user-mode.
Hmm. That should fix the minor security issue, but it will even
further break cross-arch tracing: now a 32-bit tracer tracing a 64-bit
task that does int $0x80 will malfunction even more than it would
have. Also, it relies on bizarre arch details IMO.
I think I prefer my version, coming momentarily.
--Andy
Powered by blists - more mailing lists