From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752550Ab1HVPNq (ORCPT ); Mon, 22 Aug 2011 11:13:46 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:58773 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751983Ab1HVPNo (ORCPT ); Mon, 22 Aug 2011 11:13:44 -0400 Date: Mon, 22 Aug 2011 16:13:05 +0100 From: Al Viro To: Borislav Petkov Cc: Andrew Lutomirski , Ingo Molnar , "H. Peter Anvin" , "user-mode-linux-devel@lists.sourceforge.net" , Richard Weinberger , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , Linus Torvalds Subject: Re: [uml-devel] SYSCALL, ptrace and syscall restart breakages (Re: [RFC] weird crap with vdso on uml/i386) Message-ID: <20110822151305.GV2203@ZenIV.linux.org.uk> References: <20110822011645.GM2203@ZenIV.linux.org.uk> <4E51B56F.3080301@zytor.com> <20110822020737.GP2203@ZenIV.linux.org.uk> <4E51D597.3060800@zytor.com> <20110822095336.GB25949@kernel.org> <20110822144051.GD2946@aftab> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110822144051.GD2946@aftab> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 22, 2011 at 04:40:51PM +0200, Borislav Petkov wrote: > Just to make sure I'm grokking this correctly - we want to use int $0x80 > only for the SYSCALL variant in __kernel_vsyscall, right? Not for all > 32-bit syscalls on a 64-bit kernel. Um... The problem is, syscall restart with SYSCALL insn is badly broken; we end up with arg2 (expected by SYSCALL in %ebp) overwritten with arg6 by IRET path. With obvious nasty results. In __kernel_vsyscall() the problem is possible to deal with; there we control the code around that sucker. It's SYSCALL in 32bit binary outside of vdso32 that causes real PITA... From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QvWC8-0006gI-0K for user-mode-linux-devel@lists.sourceforge.net; Mon, 22 Aug 2011 15:13:44 +0000 Received: from zeniv.linux.org.uk ([195.92.253.2]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1QvWC6-00079F-OU for user-mode-linux-devel@lists.sourceforge.net; Mon, 22 Aug 2011 15:13:43 +0000 Date: Mon, 22 Aug 2011 16:13:05 +0100 From: Al Viro Message-ID: <20110822151305.GV2203@ZenIV.linux.org.uk> References: <20110822011645.GM2203@ZenIV.linux.org.uk> <4E51B56F.3080301@zytor.com> <20110822020737.GP2203@ZenIV.linux.org.uk> <4E51D597.3060800@zytor.com> <20110822095336.GB25949@kernel.org> <20110822144051.GD2946@aftab> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110822144051.GD2946@aftab> List-Id: The user-mode Linux development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: user-mode-linux-devel-bounces@lists.sourceforge.net Subject: Re: [uml-devel] SYSCALL, ptrace and syscall restart breakages (Re: [RFC] weird crap with vdso on uml/i386) To: Borislav Petkov Cc: Andrew Lutomirski , "user-mode-linux-devel@lists.sourceforge.net" , Richard Weinberger , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , "H. Peter Anvin" , Linus Torvalds , Ingo Molnar On Mon, Aug 22, 2011 at 04:40:51PM +0200, Borislav Petkov wrote: > Just to make sure I'm grokking this correctly - we want to use int $0x80 > only for the SYSCALL variant in __kernel_vsyscall, right? Not for all > 32-bit syscalls on a 64-bit kernel. Um... The problem is, syscall restart with SYSCALL insn is badly broken; we end up with arg2 (expected by SYSCALL in %ebp) overwritten with arg6 by IRET path. With obvious nasty results. In __kernel_vsyscall() the problem is possible to deal with; there we control the code around that sucker. It's SYSCALL in 32bit binary outside of vdso32 that causes real PITA... ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel