From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756799Ab2ASBpc (ORCPT ); Wed, 18 Jan 2012 20:45:32 -0500 Received: from smarthost1.greenhost.nl ([195.190.28.78]:41389 "EHLO smarthost1.greenhost.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755398Ab2ASBpa (ORCPT ); Wed, 18 Jan 2012 20:45:30 -0500 Message-ID: In-Reply-To: References: <20120116183730.GB21112@redhat.com> <20120117170512.GB17070@redhat.com> <49017bd7edab7010cd9ac767e39d99e4.squirrel@webmail.greenhost.nl> <20120118015013.GR11715@one.firstfloor.org> <20120118020453.GL7180@jl-vm1.vm.bytemark.co.uk> <20120118022217.GS11715@one.firstfloor.org> <4F1731C1.4050007@zytor.com> <4F1733DF.7040905@zytor.com> Date: Thu, 19 Jan 2012 02:45:01 +0100 Subject: Re: Compat 32-bit syscall entry from 64-bit task!? From: "Indan Zupancic" To: "Linus Torvalds" Cc: "H. Peter Anvin" , "Andi Kleen" , "Jamie Lokier" , "Andrew Lutomirski" , "Oleg Nesterov" , "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@redhat.com, "Roland McGrath" User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam-Score: 1.4 X-Scan-Signature: 4052b6d1c9976086d5ab5ce040fcf5b8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, January 18, 2012 22:26, Linus Torvalds wrote: > On Wed, Jan 18, 2012 at 1:04 PM, H. Peter Anvin wrote: >> >> Fair enough. Sigh. I still think an actual pseudo-register would be >> better. > > .. and that breaks existing binaries too, because the indexing is > based on offsets into "struct pt_regs", and while we *could* change > that - leave pt_regs untouched but add a new virtual register - it > would be problematic. > > We could add a whole new ptrace() access command (eg > PTRACE_GETSYSTEMREGSET), of course. But that's a lot of effort for > very little gain. > > So on the whole, putting it in eflags seemed like the *much* simpler approach. For security reasons it should be impossible for userspace to set those bits themselves, otherwise the tracer can be easily fooled on an old kernel. That seems to be the case for the higher bits of eflags, so eflags would work. And the current code checks cs, also checking eflags would be very easy to add. Greetings, Indan