Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Chris Lattner
On Mar 6, 2008, at 2:06 PM, Andi Kleen wrote: On Thu, Mar 06, 2008 at 12:56:16PM -0800, H. Peter Anvin wrote: Richard Guenther wrote: A patched GCC IMHO makes only sense if it is always-on, yet another option won't help in corner cases. And corner cases is exactly what people seem to ca

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Richard Guenther
On Thu, Mar 6, 2008 at 11:06 PM, Andi Kleen <[EMAIL PROTECTED]> wrote: > > On Thu, Mar 06, 2008 at 12:56:16PM -0800, H. Peter Anvin wrote: > > Richard Guenther wrote: > > > > > >A patched GCC IMHO makes only sense if it is always-on, yet another option > > >won't help in corner cases. And corn

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Andi Kleen
On Thu, Mar 06, 2008 at 12:56:16PM -0800, H. Peter Anvin wrote: > Richard Guenther wrote: > > > >A patched GCC IMHO makes only sense if it is always-on, yet another option > >won't help in corner cases. And corner cases is exactly what people seem > >to care about. For this reason that we have th

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Artur Skawina
Jack Lloyd wrote: > But still: so the threat here is of a malicious process with the > ability to send arbitrary signals to any process using CAP_KILL (since > in any other case when a process can send a signal, it can do much > more damage in other ways), which could leverage that into > (potentia

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H. Peter Anvin
Richard Guenther wrote: A patched GCC IMHO makes only sense if it is always-on, yet another option won't help in corner cases. And corner cases is exactly what people seem to care about. For this reason that we have this single release, 4.3.0, that behaves "bad" is already a problem. The op

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Richard Guenther
On Thu, Mar 6, 2008 at 6:34 PM, Joe Buck <[EMAIL PROTECTED]> wrote: > > On Thu, Mar 06, 2008 at 01:06:17PM +0100, Richard Guenther wrote: > > On 06 Mar 2008 12:45:57 +0100, Andi Kleen <[EMAIL PROTECTED]> wrote: > > > Andrew Haley <[EMAIL PROTECTED]> writes: > > > > > > > > I suppose one could

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H. Peter Anvin
Robert Dewar wrote: Not really, it's just a matter of time. Typical distro cycles are on the order of 3 years. -hpa again, in the real world, there are MANY projects that are nothing like this interactive when it comes to moving to new versions of operating systems. This is true, but

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Jack Lloyd
On Thu, Mar 06, 2008 at 08:43:27PM +0100, Paolo Bonzini wrote: > Jack Lloyd wrote: > >On Thu, Mar 06, 2008 at 07:13:20PM +0100, Paolo Bonzini wrote: > >>A process can send a signal via kill. IOW, a malicious process can > >>*control when the process would be interrupted* in order to get it into

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Paolo Bonzini
If the malicious process can send a signal to another process, it could also ptrace() it. Which is more useful, if you wanted to be malicious? And more to the point, it can happen before GCC 4.3.0. Yes, and that's why the kernel should just fix it, and the fix should be backported and trea

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Paolo Bonzini
Jack Lloyd wrote: On Thu, Mar 06, 2008 at 07:13:20PM +0100, Paolo Bonzini wrote: A process can send a signal via kill. IOW, a malicious process can *control when the process would be interrupted* in order to get it into the signal handler with DF=1. If the malicious process can send a signal

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Robert Dewar
H.J. Lu wrote: Icc has been following psABI for years on Linux and it doesn't stop people using icc on Linux. On the other hand, it may be a good idea to provide a workaround in gcc and enables it by default. OSVs can fix thekernel and disable it by default. How widely is icc used? I ask bec

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Robert Dewar
H. Peter Anvin wrote: Robert Dewar wrote: H.J. Lu wrote: So that is the bug in the Linux kernel. Since fixing kernel is much easier than providing a workaround in compilers, I think kernel should be fixed and no need for icc/gcc fix. Fixing a bug in the Linux kernel is not "much easier". You

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Andrew Pinski
On 3/6/08, Jack Lloyd <[EMAIL PROTECTED]> wrote: > On Thu, Mar 06, 2008 at 07:13:20PM +0100, Paolo Bonzini wrote: > > A process can send a signal via kill. IOW, a malicious process can > > *control when the process would be interrupted* in order to get it into > > the signal handler with DF=1.

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Jack Lloyd
On Thu, Mar 06, 2008 at 07:13:20PM +0100, Paolo Bonzini wrote: > A process can send a signal via kill. IOW, a malicious process can > *control when the process would be interrupted* in order to get it into > the signal handler with DF=1. If the malicious process can send a signal to another pro

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Paolo Bonzini
Olivier Galibert wrote: On Thu, Mar 06, 2008 at 09:58:41AM -0800, Joe Buck wrote: If the kernel allows state to leak from one process to another, for example from a process running as root to a process running as an ordinary user, it's a bug, with possible security implications. I don't think

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Olivier Galibert
On Thu, Mar 06, 2008 at 09:58:41AM -0800, Joe Buck wrote: > If the kernel allows state to leak from one process to another, > for example from a process running as root to a process running as an > ordinary user, it's a bug, with possible security implications. I don't think that it is relevant in

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Joe Buck
On Thu, Mar 06, 2008 at 03:12:21PM +0100, Olivier Galibert wrote: > On Thu, Mar 06, 2008 at 03:03:15PM +0100, Paolo Bonzini wrote: > > Olivier Galibert wrote: > > >On Wed, Mar 05, 2008 at 05:12:07PM -0800, H. Peter Anvin wrote: > > >>It's a kernel bug, and it needs to be fixed. > > > > > >I'm not c

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Joe Buck
On Thu, Mar 06, 2008 at 01:06:17PM +0100, Richard Guenther wrote: > On 06 Mar 2008 12:45:57 +0100, Andi Kleen <[EMAIL PROTECTED]> wrote: > > Andrew Haley <[EMAIL PROTECTED]> writes: > > > > > > I suppose one could apply the precautionary principle, but those systems > > that > > > don't update

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H.J. Lu
On Thu, Mar 6, 2008 at 9:17 AM, H. Peter Anvin <[EMAIL PROTECTED]> wrote: > H.J. Lu wrote: > >> > >> Not a fix, an (optional) workaround for a system bug. > > > > So that is the bug in the Linux kernel. Since fixing kernel is much easier > > than providing a workaround in compilers, I think k

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H. Peter Anvin
Robert Dewar wrote: H.J. Lu wrote: So that is the bug in the Linux kernel. Since fixing kernel is much easier than providing a workaround in compilers, I think kernel should be fixed and no need for icc/gcc fix. Fixing a bug in the Linux kernel is not "much easier". You are taking a purely e

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H. Peter Anvin
Robert Dewar wrote: Sounds good, but has almost nothing to do with the real world. I remember back in Realia COBOL days, we had to carefully copy IBM bugs in the IBM mainframe COBOL compiler. Doing things right and fixing the bug would have been the right thing to do, but no one would have use

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H. Peter Anvin
H.J. Lu wrote: Not a fix, an (optional) workaround for a system bug. So that is the bug in the Linux kernel. Since fixing kernel is much easier than providing a workaround in compilers, I think kernel should be fixed and no need for icc/gcc fix. The problem is, you're going to have to be a

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Robert Dewar
H.J. Lu wrote: So that is the bug in the Linux kernel. Since fixing kernel is much easier than providing a workaround in compilers, I think kernel should be fixed and no need for icc/gcc fix. Fixing a bug in the Linux kernel is not "much easier". You are taking a purely engineering viewpoint,

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H.J. Lu
On Thu, Mar 6, 2008 at 9:06 AM, H. Peter Anvin <[EMAIL PROTECTED]> wrote: > > H.J. Lu wrote: > > On Thu, Mar 6, 2008 at 8:23 AM, Jakub Jelinek <[EMAIL PROTECTED]> wrote: > >> On Thu, Mar 06, 2008 at 07:50:12AM -0800, H. Peter Anvin wrote: > >> > H.J. Lu wrote: > >> > >I agree with it. There i

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H. Peter Anvin
H.J. Lu wrote: On Thu, Mar 6, 2008 at 8:23 AM, Jakub Jelinek <[EMAIL PROTECTED]> wrote: On Thu, Mar 06, 2008 at 07:50:12AM -0800, H. Peter Anvin wrote: > H.J. Lu wrote: > >I agree with it. There is no right or wrong here Let's start from > >scratch and figure out > >what is the best way to

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H.J. Lu
On Thu, Mar 6, 2008 at 8:23 AM, Jakub Jelinek <[EMAIL PROTECTED]> wrote: > On Thu, Mar 06, 2008 at 07:50:12AM -0800, H. Peter Anvin wrote: > > H.J. Lu wrote: > > >I agree with it. There is no right or wrong here Let's start from > > >scratch and figure out > > >what is the best way to handle t

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Paolo Bonzini
Another story, the sad story of the intel chip (I think it was the 80188) where Intel made use of Int 5, which was documented as reserved. Unfortunately, Microsoft/IBM had used this for print screen or some such. Intel was absolutely right that their documentation was clear and it was wrong to h

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread İsmail Dönmez
Hi, On Thu, Mar 6, 2008 at 6:23 PM, Jakub Jelinek <[EMAIL PROTECTED]> wrote: > On Thu, Mar 06, 2008 at 07:50:12AM -0800, H. Peter Anvin wrote: > > H.J. Lu wrote: > > >I agree with it. There is no right or wrong here Let's start from > > >scratch and figure out > > >what is the best way to han

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Jakub Jelinek
On Thu, Mar 06, 2008 at 07:50:12AM -0800, H. Peter Anvin wrote: > H.J. Lu wrote: > >I agree with it. There is no right or wrong here Let's start from > >scratch and figure out > >what is the best way to handle this, assuming we are defining a new psABI. BTW, just tested icc and icc doesn't genera

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Artur Skawina
feature. The bug is in the > documentation, nowhere else. And in gcc for blindly trusting the > documentation. well, you could see this either way -- either the kernel is buggy and needs to be fixed or the current behavior is correct and the abi needs an errata. If there were no performance i

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Robert Dewar
NightStrike wrote: On 3/6/08, Olivier Galibert <[EMAIL PROTECTED]> wrote: On Wed, Mar 05, 2008 at 05:12:07PM -0800, H. Peter Anvin wrote: It's a kernel bug, and it needs to be fixed. I'm not convinced. It's been that way for 15 years, it's that way in the BSD kernels, at that point it's a fea

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H. Peter Anvin
H.J. Lu wrote: I agree with it. There is no right or wrong here Let's start from scratch and figure out what is the best way to handle this, assuming we are defining a new psABI. No, I believe the right way to approach this is by applying the good old-fashioned principle from Ask Mr. Protocol

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H.J. Lu
I agree with it. There is no right or wrong here Let's start from scratch and figure out what is the best way to handle this, assuming we are defining a new psABI. H.J. On Thu, Mar 6, 2008 at 7:37 AM, NightStrike <[EMAIL PROTECTED]> wrote: > > On 3/6/08, Olivier Galibert <[EMAIL PROTECTED]> wrote

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread NightStrike
On 3/6/08, Olivier Galibert <[EMAIL PROTECTED]> wrote: > On Wed, Mar 05, 2008 at 05:12:07PM -0800, H. Peter Anvin wrote: > > It's a kernel bug, and it needs to be fixed. > > I'm not convinced. It's been that way for 15 years, it's that way in > the BSD kernels, at that point it's a feature. The b

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread H. Peter Anvin
Jakub Jelinek wrote: On Thu, Mar 06, 2008 at 09:44:05AM +0100, Andi Kleen wrote: "H. Peter Anvin" <[EMAIL PROTECTED]> writes: Richard Guenther wrote: We didn't yet run into this issue and build openSUSE with 4.3 since more than three month. Well, how often do you take a trap inside an overl

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Robert Dewar
Olivier Galibert wrote: On Wed, Mar 05, 2008 at 05:12:07PM -0800, H. Peter Anvin wrote: It's a kernel bug, and it needs to be fixed. I'm not convinced. It's been that way for 15 years, it's that way in the BSD kernels, at that point it's a feature. The bug is in the documentation, nowhere el

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Andrew Haley
Olivier Galibert wrote: > On Thu, Mar 06, 2008 at 03:03:15PM +0100, Paolo Bonzini wrote: >> Olivier Galibert wrote: >>> On Wed, Mar 05, 2008 at 05:12:07PM -0800, H. Peter Anvin wrote: It's a kernel bug, and it needs to be fixed. >>> I'm not convinced. It's been that way for 15 years, it's tha

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Olivier Galibert
On Thu, Mar 06, 2008 at 03:03:15PM +0100, Paolo Bonzini wrote: > Olivier Galibert wrote: > >On Wed, Mar 05, 2008 at 05:12:07PM -0800, H. Peter Anvin wrote: > >>It's a kernel bug, and it needs to be fixed. > > > >I'm not convinced. It's been that way for 15 years, it's that way in > >the BSD kernel

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Olivier Galibert
On Wed, Mar 05, 2008 at 03:21:43PM -0800, David Daney wrote: > Olivier Galibert wrote: > >On Wed, Mar 05, 2008 at 10:43:33PM +0100, Michael Matz wrote: > >>FWIW I don't think it's a release blocker for 4.3.0. The error is arcane > >>and happens seldomly if at all. And only on unfixed kernels. A

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Paolo Bonzini
Olivier Galibert wrote: On Wed, Mar 05, 2008 at 05:12:07PM -0800, H. Peter Anvin wrote: It's a kernel bug, and it needs to be fixed. I'm not convinced. It's been that way for 15 years, it's that way in the BSD kernels, at that point it's a feature. The bug is in the documentation, nowhere el

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Olivier Galibert
On Wed, Mar 05, 2008 at 05:12:07PM -0800, H. Peter Anvin wrote: > It's a kernel bug, and it needs to be fixed. I'm not convinced. It's been that way for 15 years, it's that way in the BSD kernels, at that point it's a feature. The bug is in the documentation, nowhere else. And in gcc for blindl

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Richard Guenther
On 06 Mar 2008 12:45:57 +0100, Andi Kleen <[EMAIL PROTECTED]> wrote: > Andrew Haley <[EMAIL PROTECTED]> writes: > > > > I suppose one could apply the precautionary principle, but those systems > that > > don't update kernels won't update gcc either, so the solution won't work. > > You seem to

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Andi Kleen
Andrew Haley <[EMAIL PROTECTED]> writes: > > I suppose one could apply the precautionary principle, but those systems that > don't update kernels won't update gcc either, so the solution won't work. You seem to assume that running a gcc 4.3 compiled binary requires a gcc update. That is not nece

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Andrew Haley
Aurelien Jarno wrote: > H. Peter Anvin a écrit : >> Michael Matz wrote: >>> >>> On Wed, 5 Mar 2008, Aurelien Jarno wrote: >>> > So I think gcc at least needs an *option* to revert to the old > behavior, > and there's a good argument to make it the default for now, at least > for >>>

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Mikael Pettersson
Aurelien Jarno writes: > On Wed, Mar 05, 2008 at 11:58:34AM -0800, Joe Buck wrote: > > > > Aurelien Jarno wrote: > > > >Since version 4.3, gcc changed its behaviour concerning the x86/x86-64 > > > >ABI and the direction flag, that is it now assu

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Jakub Jelinek
On Wed, Mar 05, 2008 at 05:12:07PM -0800, H. Peter Anvin wrote: > It's a kernel bug, and it needs to be fixed. The discussion is about > what to do in the meantime. While it is known that 32-bit glibc memmove and also inlines for memmove and memrchr use std; some string op; cld;, 64-bit glibc d

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Jakub Jelinek
On Thu, Mar 06, 2008 at 09:44:05AM +0100, Andi Kleen wrote: > "H. Peter Anvin" <[EMAIL PROTECTED]> writes: > > > Richard Guenther wrote: > > > We didn't yet run into this issue and build openSUSE with 4.3 since > > > more than > > > three month. > > > > > > > Well, how often do you take a trap in

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-06 Thread Andi Kleen
"H. Peter Anvin" <[EMAIL PROTECTED]> writes: > Richard Guenther wrote: > > We didn't yet run into this issue and build openSUSE with 4.3 since > > more than > > three month. > > > > Well, how often do you take a trap inside an overlapping memmove()? That was the state with older gcc, but with ne

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Krzysztof Halasa
"H. Peter Anvin" <[EMAIL PROTECTED]> writes: > Not quite, but fixing it in the kernel is easy. > > Still breaks for running on all old kernels. Many more things break on old kernels. I guess it's not worse than a (local) root exploit, is it? *-stable and distributions should take care of it, as

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread H. Peter Anvin
Chris Lattner wrote: Upon return to userspace, the modified state kicks in. Thus the signal handler is entered with DF from userspace at trap time, not DF=0. So it's an asynchronous state leak from one piece of userspace to another. Fine, it can happen either way. In either case, the dis

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Chris Lattner
On Mar 5, 2008, at 4:47 PM, H. Peter Anvin wrote: Chris Lattner wrote: Richard Guenther wrote: We didn't yet run into this issue and build openSUSE with 4.3 since more than three month. Well, how often do you take a trap inside an overlapping memmove()? How hard is it to change the ke

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread H. Peter Anvin
Chris Lattner wrote: Richard Guenther wrote: We didn't yet run into this issue and build openSUSE with 4.3 since more than three month. Well, how often do you take a trap inside an overlapping memmove()? How hard is it to change the kernel signal entry path from "pushf" to "pushf;cld"? Pro

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Aurelien Jarno
Chris Lattner a écrit : Richard Guenther wrote: > We didn't yet run into this issue and build openSUSE with 4.3 since > more > than > three month. Well, how often do you take a trap inside an overlapping memmove()? >>> >>> How hard is it to change the kernel signal en

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Chris Lattner
ode does string operation Fixing this instance of the problem by changing GCC requires (at least) recompiling the kernel. Changing the ABI for this seems like a pretty crazy solution to a very minor and easily fixable kernel bug. Distros have control over what kernels they ship, they have abso

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread David Daney
Olivier Galibert wrote: On Wed, Mar 05, 2008 at 10:43:33PM +0100, Michael Matz wrote: FWIW I don't think it's a release blocker for 4.3.0. The error is arcane and happens seldomly if at all. And only on unfixed kernels. A program needs to do std explicitely, which most don't do _and_ get hit

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Olivier Galibert
On Wed, Mar 05, 2008 at 10:43:33PM +0100, Michael Matz wrote: > FWIW I don't think it's a release blocker for 4.3.0. The error is arcane > and happens seldomly if at all. And only on unfixed kernels. A program > needs to do std explicitely, which most don't do _and_ get hit by a signal > whil

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Joe Buck
On Wed, Mar 05, 2008 at 03:10:12PM -0800, David Miller wrote: > From: Michael Matz <[EMAIL PROTECTED]> > Date: Thu, 6 Mar 2008 00:07:39 +0100 (CET) > > > The fix lies in the kernel, the work-around in gcc. > > This depends upon how you interpret this ABI situation.

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Olivier Galibert
On Thu, Mar 06, 2008 at 12:13:04AM +0200, Adrian Bunk wrote: > Compiling older kernels with new gcc versions has never been supported. You read the thread too fast. It's not at all about compiling the kernel. OG.

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Olivier Galibert
On Thu, Mar 06, 2008 at 12:07:39AM +0100, Michael Matz wrote: > For security problems I prefer fixes over work-arounds. The fix lies in > the kernel, the work-around in gcc. Incorrect. The bugs are in the ABI documentation and in gcc, and the fixes should be done there. Doing it in the

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread David Miller
From: Michael Matz <[EMAIL PROTECTED]> Date: Thu, 6 Mar 2008 00:07:39 +0100 (CET) > The fix lies in the kernel, the work-around in gcc. This depends upon how you interpret this ABI situation. There is at least some agreement that how things have actually been implemented by these ke

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Michael Matz
Hi, On Wed, 5 Mar 2008, H. Peter Anvin wrote: > Michael Matz wrote: > > > > Many bugs are a big issue to people who actually hit them, and we had (and > > probably still have) far nastier corner case miscompilations here and there > > and nevertheless released. It never was the end of the world

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread H. Peter Anvin
Michael Matz wrote: Many bugs are a big issue to people who actually hit them, and we had (and probably still have) far nastier corner case miscompilations here and there and nevertheless released. It never was the end of the world :) This is the sort of stuff that security holes are made

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Michael Matz
Hi, On Wed, 5 Mar 2008, David Miller wrote: > I will be sure to hunt you down to help debug when someone reports that > once every few weeks their multi-day simulation gives incorrect results > :-) Give them a LD_PRELOADable DSO that intercepts signal() and sig_action(), installing a trampoli

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Joe Buck
On Wed, Mar 05, 2008 at 02:16:22PM -0800, David Miller wrote: > From: "Richard Guenther" <[EMAIL PROTECTED]> > Date: Wed, 5 Mar 2008 22:40:59 +0100 > > > Right. So this problem is over-exaggerated. It's not like > > "any binary you create on that system will be broken on any > > other existing s

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread David Miller
From: Adrian Bunk <[EMAIL PROTECTED]> Date: Thu, 6 Mar 2008 00:13:04 +0200 > On Wed, Mar 05, 2008 at 10:59:21PM +0100, Michael Matz wrote: > > The problem is with old kernels, which by definition stay unfixed. > > Compiling older kernels with new gcc versions has never been supported. Adrian we'

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread David Miller
From: Michael Matz <[EMAIL PROTECTED]> Date: Wed, 5 Mar 2008 22:43:33 +0100 (CET) > The error is arcane and happens seldomly if at all. And only on > unfixed kernels. Which translates right now into "all kernels."

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread David Miller
From: "Richard Guenther" <[EMAIL PROTECTED]> Date: Wed, 5 Mar 2008 22:40:59 +0100 > Right. So this problem is over-exaggerated. It's not like > "any binary you create on that system will be broken on any > other existing system." I will be sure to hunt you down to help debug when someone report

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Adrian Bunk
On Wed, Mar 05, 2008 at 10:59:21PM +0100, Michael Matz wrote: > Hi, > > On Wed, 5 Mar 2008, Chris Lattner wrote: > > > > > On Mar 5, 2008, at 1:34 PM, H. Peter Anvin wrote: > > > > >Richard Guenther wrote: > > > >We didn't yet run into this issue and build openSUSE with 4.3 since more > > > >th

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Joe Buck
On Wed, Mar 05, 2008 at 10:43:33PM +0100, Michael Matz wrote: > Hi, > > On Wed, 5 Mar 2008, Joe Buck wrote: > > > > > > > On Wed, 5 Mar 2008, Jan Hubicka wrote: > > > > Linux kernel is disabling red zone and use kernel code model, yet the > &

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread H. Peter Anvin
Chris Lattner wrote: On Mar 5, 2008, at 1:34 PM, H. Peter Anvin wrote: Richard Guenther wrote: We didn't yet run into this issue and build openSUSE with 4.3 since more than three month. Well, how often do you take a trap inside an overlapping memmove()? How hard is it to change the kerne

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Michael Matz
Hi, On Wed, 5 Mar 2008, Chris Lattner wrote: > > On Mar 5, 2008, at 1:34 PM, H. Peter Anvin wrote: > > >Richard Guenther wrote: > > >We didn't yet run into this issue and build openSUSE with 4.3 since more > > >than > > >three month. > > > >Well, how often do you take a trap inside an overlappi

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Chris Lattner
On Mar 5, 2008, at 1:34 PM, H. Peter Anvin wrote: Richard Guenther wrote: We didn't yet run into this issue and build openSUSE with 4.3 since more than three month. Well, how often do you take a trap inside an overlapping memmove()? How hard is it to change the kernel signal entry path f

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Aurelien Jarno
Richard Guenther a écrit : > On Wed, Mar 5, 2008 at 10:20 PM, Joe Buck <[EMAIL PROTECTED]> wrote: >> >> On Wed, 5 Mar 2008, Jan Hubicka wrote: >> > > Linux kernel is disabling red zone and use kernel code model, yet the >> > > ABI is not going to

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Richard Guenther
On Wed, Mar 5, 2008 at 10:43 PM, Joe Buck <[EMAIL PROTECTED]> wrote: > > On Wed, Mar 05, 2008 at 01:34:14PM -0800, H. Peter Anvin wrote: > > Richard Guenther wrote: > > > > > >We didn't yet run into this issue and build openSUSE with 4.3 since more > > >than > > >three month. > > > > > > >

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Michael Matz
Hi, On Wed, 5 Mar 2008, Joe Buck wrote: > > > On Wed, 5 Mar 2008, Jan Hubicka wrote: > > > Linux kernel is disabling red zone and use kernel code model, yet the > > > ABI is not going to be adjusted for that. > > > > > > This is resonably easy to

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Andrew Pinski
There are already gcc 4.3.0 packages on the FTP site. Sent from my iPhone On Mar 5, 2008, at 13:20, Joe Buck <[EMAIL PROTECTED]> wrote: On Wed, 5 Mar 2008, Jan Hubicka wrote: Linux kernel is disabling red zone and use kernel code model, yet the ABI is not going to be adjusted fo

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Joe Buck
On Wed, Mar 05, 2008 at 01:34:14PM -0800, H. Peter Anvin wrote: > Richard Guenther wrote: > > > >We didn't yet run into this issue and build openSUSE with 4.3 since more > >than > >three month. > > > > Well, how often do you take a trap inside an overlapping memmove()? Also, would it be possible

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Richard Guenther
On Wed, Mar 5, 2008 at 10:34 PM, H. Peter Anvin <[EMAIL PROTECTED]> wrote: > Richard Guenther wrote: > > > > We didn't yet run into this issue and build openSUSE with 4.3 since more > than > > three month. > > > > Well, how often do you take a trap inside an overlapping memmove()? Right. So

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread H. Peter Anvin
Richard Guenther wrote: We didn't yet run into this issue and build openSUSE with 4.3 since more than three month. Well, how often do you take a trap inside an overlapping memmove()? -hpa

Re: RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Richard Guenther
On Wed, Mar 5, 2008 at 10:20 PM, Joe Buck <[EMAIL PROTECTED]> wrote: > > > On Wed, 5 Mar 2008, Jan Hubicka wrote: > > > Linux kernel is disabling red zone and use kernel code model, yet the > > > ABI is not going to be adjusted for that. > > > >

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread David Miller
irection flag behavior, any binary you create on that system will be broken on any other existing system. I think we really are stuck with this forever, overwhelming practice over the past 15 years has dictated to us what the real ABI is.

RELEASE BLOCKER: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Joe Buck
On Wed, 5 Mar 2008, Jan Hubicka wrote: > > Linux kernel is disabling red zone and use kernel code model, yet the > > ABI is not going to be adjusted for that. > > > > This is resonably easy to fix on kernel side in signal handling, or by > > removing std usage co

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread H. Peter Anvin
Jan Hubicka wrote: Yes, if there are four kernels that get it "wrong", that effectively means that the ABI document doesn't describe reality and gcc has to adjust. Kernels almost never follow ABI used by applications to last detail. Linux kernel is disabling red zone and use ke

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Michael Matz
Hi, On Wed, 5 Mar 2008, Jan Hubicka wrote: > Kernels almost never follow ABI used by applications to last detail. But we aren't talking about the ABI the kernel uses internally, but about what is exposed to user-space via signal handlers. _That_ part needs to be followed, and if

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Aurelien Jarno
H. Peter Anvin a écrit : > Michael Matz wrote: >> Hi, >> >> On Wed, 5 Mar 2008, Aurelien Jarno wrote: >> So I think gcc at least needs an *option* to revert to the old behavior, and there's a good argument to make it the default for now, at least for x86/x86-64 on Linux. >>

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Jan Hubicka
fore calling the signal handler. > > > > Sigh. We could perhaps insert a cld for all functions which can be > > recognized as possible signal handlers and call other unknown or string > > functions. But it's probably even faster to emit cld in front of the > >

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread H. Peter Anvin
Michael Matz wrote: Hi, On Wed, 5 Mar 2008, Aurelien Jarno wrote: So I think gcc at least needs an *option* to revert to the old behavior, and there's a good argument to make it the default for now, at least for x86/x86-64 on Linux. And for other kernels. I tested OpenBSD 4.1, FreeBSD 6.3, Net

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Joe Buck
d perhaps insert a cld for all functions which can be > recognized as possible signal handlers and call other unknown or string > functions. But it's probably even faster to emit cld in front of the > inline copies of mem functions again :-( Yes, if there are four kernels that get it

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Michael Matz
Hi, On Wed, 5 Mar 2008, Aurelien Jarno wrote: > > So I think gcc at least needs an *option* to revert to the old behavior, > > and there's a good argument to make it the default for now, at least for > > x86/x86-64 on Linux. > > And for other kernels. I tested OpenBSD 4.1, FreeBSD 6.3, NetBSD 4.

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Aurelien Jarno
On Wed, Mar 05, 2008 at 11:58:34AM -0800, Joe Buck wrote: > > Aurelien Jarno wrote: > > >Since version 4.3, gcc changed its behaviour concerning the x86/x86-64 > > >ABI and the direction flag, that is it now assumes that the direction > > >flag is cleared

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Joe Buck
Aurelien Jarno wrote: > >Since version 4.3, gcc changed its behaviour concerning the x86/x86-64 > >ABI and the direction flag, that is it now assumes that the direction > >flag is cleared at the entry of a function and it doesn't clear once > >more if needed. >

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread H.J. Lu
eared when calling a signal handler. H.J. On Wed, Mar 5, 2008 at 7:30 AM, Aurelien Jarno <[EMAIL PROTECTED]> wrote: > Hi all, > > Since version 4.3, gcc changed its behaviour concerning the x86/x86-64 > ABI and the direction flag, that is it now assumes that the direction > fl

Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread H. Peter Anvin
Aurelien Jarno wrote: Hi all, Since version 4.3, gcc changed its behaviour concerning the x86/x86-64 ABI and the direction flag, that is it now assumes that the direction flag is cleared at the entry of a function and it doesn't clear once more if needed. This causes some problems wit

Linux doesn't follow x86/x86-64 ABI wrt direction flag

2008-03-05 Thread Aurelien Jarno
Hi all, Since version 4.3, gcc changed its behaviour concerning the x86/x86-64 ABI and the direction flag, that is it now assumes that the direction flag is cleared at the entry of a function and it doesn't clear once more if needed. This causes some problems with the Linux kernel which

Re: Draft SH uClinux FDPIC ABI

2008-02-29 Thread Alexandre Oliva
On Feb 29, 2008, "Joseph S. Myers" <[EMAIL PROTECTED]> wrote: > Thanks - there were lots more typos in the original (spell-checking it > might be a good idea). Indeed :-( Thanks. >> I've just fixed it in FR-V FDPIC 1.0b. > Is there a more recent location to reference than >

Re: Draft SH uClinux FDPIC ABI

2008-02-29 Thread Joseph S. Myers
On Thu, 28 Feb 2008, Alexandre Oliva wrote: > It was the need for using the atomic 64-bit load/store instructions > that motivated us to use 64-bit alignment for function descriptors on > FR-V. Since SH doesn't have 64-bit load/store instructions, there's > no need for function descriptors to be

Re: Draft SH uClinux FDPIC ABI

2008-02-27 Thread Alexandre Oliva
On Feb 26, 2008, "Joseph S. Myers" <[EMAIL PROTECTED]> wrote: > Here is a draft FDPIC ABI for SH uClinux, based on the FR-V FDPIC ABI. > Please send any comments; CodeSourcery will be implementing the final ABI > version in GCC and Binutils. Cool! Great news

Re: Draft SH uClinux FDPIC ABI

2008-02-27 Thread Joseph S. Myers
On Wed, 27 Feb 2008, Kaz Kojima wrote: > "Joseph S. Myers" <[EMAIL PROTECTED]> wrote: > > Here is a draft FDPIC ABI for SH uClinux, based on the FR-V FDPIC ABI. > > Please send any comments; CodeSourcery will be implementing the final ABI > > version in G

Re: Draft SH uClinux FDPIC ABI

2008-02-27 Thread Kaz Kojima
"Joseph S. Myers" <[EMAIL PROTECTED]> wrote: > Here is a draft FDPIC ABI for SH uClinux, based on the FR-V FDPIC ABI. > Please send any comments; CodeSourcery will be implementing the final ABI > version in GCC and Binutils. Wow, great news! One minor point I'

Draft SH uClinux FDPIC ABI

2008-02-26 Thread Joseph S. Myers
Here is a draft FDPIC ABI for SH uClinux, based on the FR-V FDPIC ABI. Please send any comments; CodeSourcery will be implementing the final ABI version in GCC and Binutils. The SH FDPIC ABI Joseph Myers

<    2   3   4   5   6   7   8   9   >