Re: GCC bug ? Re: [PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection

2020-01-22 Thread Christophe Leroy
Le 22/01/2020 à 14:36, Segher Boessenkool a écrit : On Wed, Jan 22, 2020 at 07:52:02AM +0100, Christophe Leroy wrote: Le 21/01/2020 à 20:55, Segher Boessenkool a écrit : On Tue, Jan 21, 2020 at 05:22:32PM +, Christophe Leroy wrote: g1() should return 3, not 5. What makes you say that?

Re: GCC bug ? Re: [PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection

2020-01-22 Thread Segher Boessenkool
On Wed, Jan 22, 2020 at 07:52:02AM +0100, Christophe Leroy wrote: > Le 21/01/2020 à 20:55, Segher Boessenkool a écrit : > >On Tue, Jan 21, 2020 at 05:22:32PM +, Christophe Leroy wrote: > >>g1() should return 3, not 5. > > > >What makes you say that? > > What makes me say that is that NULL is o

Re: GCC bug ? Re: [PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection

2020-01-22 Thread Segher Boessenkool
Hi! On Wed, Jan 22, 2020 at 07:57:15AM +0100, Christophe Leroy wrote: > GCC doc also says: > > "if you use it in an inlined function and pass an argument of the > function as the argument to the built-in, GCC never returns 1 when you > call the inline function with a string constant" > > Does

Re: GCC bug ? Re: [PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection

2020-01-21 Thread Christophe Leroy
Le 21/01/2020 à 20:55, Segher Boessenkool a écrit : On Tue, Jan 21, 2020 at 05:22:32PM +, Christophe Leroy wrote: g1() should return 3, not 5. What makes you say that? "A return of 0 does not indicate that the value is _not_ a constant, but merely that GCC cannot prove it is a cons

Re: GCC bug ? Re: [PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection

2020-01-21 Thread Christophe Leroy
Le 21/01/2020 à 20:55, Segher Boessenkool a écrit : On Tue, Jan 21, 2020 at 05:22:32PM +, Christophe Leroy wrote: g1() should return 3, not 5. What makes you say that? What makes me say that is that NULL is obviously a constant pointer and I think we are all expecting gcc to see it a

Re: GCC bug ? Re: [PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection

2020-01-21 Thread Segher Boessenkool
On Tue, Jan 21, 2020 at 05:22:32PM +, Christophe Leroy wrote: > g1() should return 3, not 5. What makes you say that? "A return of 0 does not indicate that the value is _not_ a constant, but merely that GCC cannot prove it is a constant with the specified value of the '-O' option." (And th

GCC bug ? Re: [PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection

2020-01-21 Thread Christophe Leroy
On 04/18/2019 06:55 AM, Michael Ellerman wrote: Christophe Leroy writes: diff --git a/arch/powerpc/include/asm/book3s/32/kup.h b/arch/powerpc/include/asm/book3s/32/kup.h index 5f97c742ca71..b3560b2de435 100644 --- a/arch/powerpc/include/asm/book3s/32/kup.h +++ b/arch/powerpc/include/asm/boo

Re: [PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection

2019-04-23 Thread Christophe Leroy
Le 18/04/2019 à 08:55, Michael Ellerman a écrit : Christophe Leroy writes: diff --git a/arch/powerpc/include/asm/book3s/32/kup.h b/arch/powerpc/include/asm/book3s/32/kup.h index 5f97c742ca71..b3560b2de435 100644 --- a/arch/powerpc/include/asm/book3s/32/kup.h +++ b/arch/powerpc/include/asm/b

Re: [PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection

2019-04-18 Thread Michael Ellerman
Christophe Leroy writes: > diff --git a/arch/powerpc/include/asm/book3s/32/kup.h > b/arch/powerpc/include/asm/book3s/32/kup.h > index 5f97c742ca71..b3560b2de435 100644 > --- a/arch/powerpc/include/asm/book3s/32/kup.h > +++ b/arch/powerpc/include/asm/book3s/32/kup.h > @@ -37,6 +37,113 @@ ... > + >

[PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection

2019-03-11 Thread Christophe Leroy
This patch implements Kernel Userspace Access Protection for book3s/32. Due to limitations of the processor page protection capabilities, the protection is only against writing. read protection cannot be achieved using page protection. The previous patch modifies the page protection so that RW us