From mboxrd@z Thu Jan 1 00:00:00 1970 From: Denys Vlasenko Subject: Re: Compat 32-bit syscall entry from 64-bit task!? Date: Thu, 26 Jan 2012 02:21:33 +0100 Message-ID: <201201260221.33224.vda.linux@googlemail.com> References: <201201260032.57937.vda.linux@googlemail.com> <20120126005901.GC18613@jl-vm1.vm.bytemark.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Oleg Nesterov , Linus Torvalds , Indan Zupancic , Andi Kleen , Andrew Lutomirski , Will Drewry , linux-kernel@vger.kernel.org, keescook@chromium.org, john.johansen@canonical.com, serge.hallyn@canonical.com, coreyb@linux.vnet.ibm.com, pmoore@redhat.com, eparis@redhat.com, djm@mindrot.org, segoon@openwall.com, rostedt@goodmis.org, jmorris@namei.org, scarybeasts@gmail.com, avi@redhat.com, penberg@cs.helsinki.fi, viro@zeniv.linux.org.uk, mingo@elte.hu, akpm@linux-foundation.org, khilman@ti.com, borislav.petkov@amd.com, amwang@redhat.com, ak@linux.intel.com, eric.dumazet@gmail.com, gregkh@suse.de, dhowells@redhat.com, daniel.lezcano@free.fr, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, olofj@chromium.org, mhalcrow@google.com, dlaor@re To: Jamie Lokier Return-path: Received: from mail-ey0-f174.google.com ([209.85.215.174]:57581 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751583Ab2AZBVj (ORCPT ); Wed, 25 Jan 2012 20:21:39 -0500 In-Reply-To: <20120126005901.GC18613@jl-vm1.vm.bytemark.co.uk> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thursday 26 January 2012 01:59, Jamie Lokier wrote: > Denys Vlasenko wrote: > > (2) syscall exit compat-ness is known from entry type - no need to indicate it; and > > (3) if we would flag syscall entry with an event value in wait status, then syscall > > exit will be already distinquisable. > > > > Thus, minimally we need one new option, PTRACE_O_TRACE_SYSENTRY - > > "on syscall entry ptrace stop, set a nonzero event value in wait status" > > , and two event values: PTRACE_EVENT_SYSCALL_ENTRY (for native entry), > > PTRACE_EVENT_SYSCALL_ENTRY1 for compat one. > > PTRACE_EVENT_SYSCALL_EXIT would cleanly indicate that the new option > is actually working without the tracer needing to do a fork+test, if > PTRACE_ATTACH is used and for some reason the tracer sees a syscall > exit first. Can't happen. After PTRACE_ATTACH, you can only see tracee dying, or getting a signal delivery (usually a SIGSTOP). Anything else would be a kernel bug. -- vda