Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932067AbWELODi (ORCPT ); Fri, 12 May 2006 10:03:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932075AbWELODi (ORCPT ); Fri, 12 May 2006 10:03:38 -0400 Received: from 167.imtp.Ilyichevsk.Odessa.UA ([195.66.192.167]:19607 "HELO ilport.com.ua") by vger.kernel.org with SMTP id S932067AbWELODh (ORCPT ); Fri, 12 May 2006 10:03:37 -0400 From: Denis Vlasenko To: Andi Kleen Subject: Re: Segfault on the i386 enter instruction Date: Fri, 12 May 2006 17:03:23 +0300 User-Agent: KMail/1.8.2 Cc: Tomasz Malesinski , linux-kernel@vger.kernel.org References: <20060512131654.GB2994@duch.mimuw.edu.pl> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605121703.23366.vda@ilport.com.ua> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1252 Lines: 29 On Friday 12 May 2006 16:50, Andi Kleen wrote: > Tomasz Malesinski writes: > > > The code attached below segfaults on the enter instruction. It works > > when a stack frame is created by the three commented out > > instructions and also when the first operand of the enter instruction > > is small (less than about 6500 on my system). > > The difference is the value of the stack pointer when the page fault > of extending the stack downwards occurs. For the long sequence > ESP is already changed when it happens. For ENTER the CPU undoes > the change before raising the fault. The page fault handler > checks the page fault against ESP to catch invalid references below > the stack. > > I don't think the 64bit kernel does anything different here than the > 32bit kernel. I tested it on a 32bit box and it faulted there too. For me, it doesn't fault. I looked with strace. It doesn't fault even with enter $64008, $0 Is it something in newest kernels? Mine is 2.6.16-rc5. -- vda - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/