All of lore.kernel.org
 help / color / mirror / Atom feed
* Regression with arm in next with stack protector
@ 2018-03-23 18:14 ` Tony Lindgren
  0 siblings, 0 replies; 30+ messages in thread
From: Tony Lindgren @ 2018-03-23 18:14 UTC (permalink / raw)
  To: Huacai Chen, Andrew Morton, Stephen Rothwell
  Cc: Ralf Baechle, James Hogan, Russell King, Yoshinori Sato,
	Rich Felker, linux-kernel, linux-arm-kernel, linux-omap

Hi,

Looks like commit 5638790dadae ("zboot: fix stack protector in
compressed boot phase") breaks booting on arm.

This is all I get from the bootloader on omap3:

Starting kernel ...

data abort
pc : [<810002d0>]          lr : [<100110a8>]
reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
sp : 81467c18  ip : 81466bf0     fp : 81466bf0
r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

Regards,

Tony

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-23 18:14 ` Tony Lindgren
  0 siblings, 0 replies; 30+ messages in thread
From: Tony Lindgren @ 2018-03-23 18:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Looks like commit 5638790dadae ("zboot: fix stack protector in
compressed boot phase") breaks booting on arm.

This is all I get from the bootloader on omap3:

Starting kernel ...

data abort
pc : [<810002d0>]          lr : [<100110a8>]
reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
sp : 81467c18  ip : 81466bf0     fp : 81466bf0
r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

Regards,

Tony

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-23 18:14 ` Tony Lindgren
@ 2018-03-23 18:45   ` Fabio Estevam
  -1 siblings, 0 replies; 30+ messages in thread
From: Fabio Estevam @ 2018-03-23 18:45 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Huacai Chen, Andrew Morton, Stephen Rothwell, Rich Felker,
	Russell King, Yoshinori Sato, linux-kernel, Ralf Baechle,
	linux-omap, James Hogan,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Fri, Mar 23, 2018 at 3:14 PM, Tony Lindgren <tony@atomide.com> wrote:
> Hi,
>
> Looks like commit 5638790dadae ("zboot: fix stack protector in
> compressed boot phase") breaks booting on arm.

Yes, almost all imx are broken in linux-next due to this commit:
https://kernelci.org/soc/imx/job/next/kernel/next-20180323/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-23 18:45   ` Fabio Estevam
  0 siblings, 0 replies; 30+ messages in thread
From: Fabio Estevam @ 2018-03-23 18:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 23, 2018 at 3:14 PM, Tony Lindgren <tony@atomide.com> wrote:
> Hi,
>
> Looks like commit 5638790dadae ("zboot: fix stack protector in
> compressed boot phase") breaks booting on arm.

Yes, almost all imx are broken in linux-next due to this commit:
https://kernelci.org/soc/imx/job/next/kernel/next-20180323/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-23 18:45   ` Fabio Estevam
@ 2018-03-23 19:15     ` Andrew Morton
  -1 siblings, 0 replies; 30+ messages in thread
From: Andrew Morton @ 2018-03-23 19:15 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Tony Lindgren, Huacai Chen, Stephen Rothwell, Rich Felker,
	Russell King, Yoshinori Sato, linux-kernel, Ralf Baechle,
	linux-omap, James Hogan,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Fri, 23 Mar 2018 15:45:27 -0300 Fabio Estevam <festevam@gmail.com> wrote:

> On Fri, Mar 23, 2018 at 3:14 PM, Tony Lindgren <tony@atomide.com> wrote:
> > Hi,
> >
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> 
> Yes, almost all imx are broken in linux-next due to this commit:
> https://kernelci.org/soc/imx/job/next/kernel/next-20180323/

Thanks, I dropped it and I expect Stephen will also do that.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-23 19:15     ` Andrew Morton
  0 siblings, 0 replies; 30+ messages in thread
From: Andrew Morton @ 2018-03-23 19:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 23 Mar 2018 15:45:27 -0300 Fabio Estevam <festevam@gmail.com> wrote:

> On Fri, Mar 23, 2018 at 3:14 PM, Tony Lindgren <tony@atomide.com> wrote:
> > Hi,
> >
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> 
> Yes, almost all imx are broken in linux-next due to this commit:
> https://kernelci.org/soc/imx/job/next/kernel/next-20180323/

Thanks, I dropped it and I expect Stephen will also do that.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-23 19:15     ` Andrew Morton
@ 2018-03-23 22:31       ` Stephen Rothwell
  -1 siblings, 0 replies; 30+ messages in thread
From: Stephen Rothwell @ 2018-03-23 22:31 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Fabio Estevam, Tony Lindgren, Huacai Chen, Rich Felker,
	Russell King, Yoshinori Sato, linux-kernel, Ralf Baechle,
	linux-omap, James Hogan,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

Hi Andrew,

On Fri, 23 Mar 2018 12:15:30 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Fri, 23 Mar 2018 15:45:27 -0300 Fabio Estevam <festevam@gmail.com> wrote:
> 
> > On Fri, Mar 23, 2018 at 3:14 PM, Tony Lindgren <tony@atomide.com> wrote:  
> > > Hi,
> > >
> > > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > > compressed boot phase") breaks booting on arm.  
> > 
> > Yes, almost all imx are broken in linux-next due to this commit:
> > https://kernelci.org/soc/imx/job/next/kernel/next-20180323/  
> 
> Thanks, I dropped it and I expect Stephen will also do that.

OK, dropped.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-23 22:31       ` Stephen Rothwell
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Rothwell @ 2018-03-23 22:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew,

On Fri, 23 Mar 2018 12:15:30 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Fri, 23 Mar 2018 15:45:27 -0300 Fabio Estevam <festevam@gmail.com> wrote:
> 
> > On Fri, Mar 23, 2018 at 3:14 PM, Tony Lindgren <tony@atomide.com> wrote:  
> > > Hi,
> > >
> > > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > > compressed boot phase") breaks booting on arm.  
> > 
> > Yes, almost all imx are broken in linux-next due to this commit:
> > https://kernelci.org/soc/imx/job/next/kernel/next-20180323/  
> 
> Thanks, I dropped it and I expect Stephen will also do that.

OK, dropped.

-- 
Cheers,
Stephen Rothwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180324/1cffead6/attachment.sig>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-23 19:15     ` Andrew Morton
  (?)
@ 2018-03-26  6:57       ` 陈华才
  -1 siblings, 0 replies; 30+ messages in thread
From: 陈华才 @ 2018-03-26  6:57 UTC (permalink / raw)
  To: Andrew Morton, Fabio Estevam
  Cc: Tony Lindgren, Stephen Rothwell, Rich Felker, Russell King,
	Yoshinori Sato, linux-kernel, Ralf Baechle, linux-omap,
	James Hogan,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Hi, Tony and Fabio,

Could you please upload your kernel binary to somewhere for me? I don't understand why some ARM boards is OK while others are broken.

Huacai
 
------------------ Original ------------------
From:  "Andrew Morton"<akpm@linux-foundation.org>;
Date:  Sat, Mar 24, 2018 03:15 AM
To:  "Fabio Estevam"<festevam@gmail.com>;
Cc:  "Tony Lindgren"<tony@atomide.com>; "Huacai Chen"<chenhc@lemote.com>; "Stephen Rothwell"<sfr@canb.auug.org.au>; "Rich Felker"<dalias@libc.org>; "Russell King"<linux@arm.linux.org.uk>; "Yoshinori Sato"<ysato@users.sourceforge.jp>; "linux-kernel"<linux-kernel@vger.kernel.org>; "Ralf Baechle"<ralf@linux-mips.org>; "linux-omap"<linux-omap@vger.kernel.org>; "James Hogan"<james.hogan@mips.com>; "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"<linux-arm-kernel@lists.infradead.org>;
Subject:  Re: Regression with arm in next with stack protector
 
On Fri, 23 Mar 2018 15:45:27 -0300 Fabio Estevam <festevam@gmail.com> wrote:

> On Fri, Mar 23, 2018 at 3:14 PM, Tony Lindgren <tony@atomide.com> wrote:
> > Hi,
> >
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> 
> Yes, almost all imx are broken in linux-next due to this commit:
> https://kernelci.org/soc/imx/job/next/kernel/next-20180323/

Thanks, I dropped it and I expect Stephen will also do that.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
@ 2018-03-26  6:57       ` 陈华才
  0 siblings, 0 replies; 30+ messages in thread
From: 陈华才 @ 2018-03-26  6:57 UTC (permalink / raw)
  To: Andrew Morton, Fabio Estevam
  Cc: Stephen Rothwell, Rich Felker, Russell King, Yoshinori Sato,
	Tony Lindgren, linux-kernel, Ralf Baechle, linux-omap,
	James Hogan,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Hi, Tony and Fabio,

Could you please upload your kernel binary to somewhere for me? I don't understand why some ARM boards is OK while others are broken.

Huacai
 
------------------ Original ------------------
From:  "Andrew Morton"<akpm@linux-foundation.org>;
Date:  Sat, Mar 24, 2018 03:15 AM
To:  "Fabio Estevam"<festevam@gmail.com>;
Cc:  "Tony Lindgren"<tony@atomide.com>; "Huacai Chen"<chenhc@lemote.com>; "Stephen Rothwell"<sfr@canb.auug.org.au>; "Rich Felker"<dalias@libc.org>; "Russell King"<linux@arm.linux.org.uk>; "Yoshinori Sato"<ysato@users.sourceforge.jp>; "linux-kernel"<linux-kernel@vger.kernel.org>; "Ralf Baechle"<ralf@linux-mips.org>; "linux-omap"<linux-omap@vger.kernel.org>; "James Hogan"<james.hogan@mips.com>; "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"<linux-arm-kernel@lists.infradead.org>;
Subject:  Re: Regression with arm in next with stack protector
 
On Fri, 23 Mar 2018 15:45:27 -0300 Fabio Estevam <festevam@gmail.com> wrote:

> On Fri, Mar 23, 2018 at 3:14 PM, Tony Lindgren <tony@atomide.com> wrote:
> > Hi,
> >
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> 
> Yes, almost all imx are broken in linux-next due to this commit:
> https://kernelci.org/soc/imx/job/next/kernel/next-20180323/

Thanks, I dropped it and I expect Stephen will also do that.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-26  6:57       ` 陈华才
  0 siblings, 0 replies; 30+ messages in thread
From: 陈华才 @ 2018-03-26  6:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, Tony and Fabio,

Could you please upload your kernel binary to somewhere for me? I don't understand why some ARM boards is OK while others are broken.

Huacai
 
------------------ Original ------------------
From:  "Andrew Morton"<akpm@linux-foundation.org>;
Date:  Sat, Mar 24, 2018 03:15 AM
To:  "Fabio Estevam"<festevam@gmail.com>;
Cc:  "Tony Lindgren"<tony@atomide.com>; "Huacai Chen"<chenhc@lemote.com>; "Stephen Rothwell"<sfr@canb.auug.org.au>; "Rich Felker"<dalias@libc.org>; "Russell King"<linux@arm.linux.org.uk>; "Yoshinori Sato"<ysato@users.sourceforge.jp>; "linux-kernel"<linux-kernel@vger.kernel.org>; "Ralf Baechle"<ralf@linux-mips.org>; "linux-omap"<linux-omap@vger.kernel.org>; "James Hogan"<james.hogan@mips.com>; "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"<linux-arm-kernel@lists.infradead.org>;
Subject:  Re: Regression with arm in next with stack protector
 
On Fri, 23 Mar 2018 15:45:27 -0300 Fabio Estevam <festevam@gmail.com> wrote:

> On Fri, Mar 23, 2018 at 3:14 PM, Tony Lindgren <tony@atomide.com> wrote:
> > Hi,
> >
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> 
> Yes, almost all imx are broken in linux-next due to this commit:
> https://kernelci.org/soc/imx/job/next/kernel/next-20180323/

Thanks, I dropped it and I expect Stephen will also do that.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-26  6:57       ` 陈华才
@ 2018-03-26 15:37         ` Tony Lindgren
  -1 siblings, 0 replies; 30+ messages in thread
From: Tony Lindgren @ 2018-03-26 15:37 UTC (permalink / raw)
  To: 陈华才
  Cc: Andrew Morton, Fabio Estevam, Stephen Rothwell, Rich Felker,
	Russell King, Yoshinori Sato, linux-kernel, Ralf Baechle,
	linux-omap, James Hogan,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

* 陈华才 <chenhc@lemote.com> [180326 06:59]:
> Hi, Tony and Fabio,
> 
> Could you please upload your kernel binary to somewhere for me? I don't understand why some ARM boards is OK while others are broken.

Well the kernel I'm testing is just current Linux next cross
compiled omap2plus_defconfig kernel. I do have few more config
options enabled like LOCKDEP and DEBUG_ATOMIC_SLEEP, but I
doubt they matter here :)

Then I'm using gcc-7.3.0 and binutils-2.30 built with the
buildall.git scripts:

git://git.infradead.org/users/segher/buildall.git

If you still need binaries, let me know.

Do you know which arm devices are working with your patch?

Regards,

Tony

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-26 15:37         ` Tony Lindgren
  0 siblings, 0 replies; 30+ messages in thread
From: Tony Lindgren @ 2018-03-26 15:37 UTC (permalink / raw)
  To: linux-arm-kernel

* ??? <chenhc@lemote.com> [180326 06:59]:
> Hi, Tony and Fabio,
> 
> Could you please upload your kernel binary to somewhere for me? I don't understand why some ARM boards is OK while others are broken.

Well the kernel I'm testing is just current Linux next cross
compiled omap2plus_defconfig kernel. I do have few more config
options enabled like LOCKDEP and DEBUG_ATOMIC_SLEEP, but I
doubt they matter here :)

Then I'm using gcc-7.3.0 and binutils-2.30 built with the
buildall.git scripts:

git://git.infradead.org/users/segher/buildall.git

If you still need binaries, let me know.

Do you know which arm devices are working with your patch?

Regards,

Tony

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-26 15:37         ` Tony Lindgren
  (?)
@ 2018-03-27  8:29           ` 陈华才
  -1 siblings, 0 replies; 30+ messages in thread
From: 陈华才 @ 2018-03-27  8:29 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Andrew Morton, Fabio Estevam, Stephen Rothwell, Rich Felker,
	Russell King, Yoshinori Sato, linux-kernel, Ralf Baechle,
	linux-omap, James Hogan,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Allwinner devices are OK, Exynos devices (except 4210) are OK.
 
------------------ Original ------------------
From:  "Tony Lindgren"<tony@atomide.com>;
Date:  Mon, Mar 26, 2018 11:37 PM
To:  "陈华才"<chenhc@lemote.com>;
Cc:  "Andrew Morton"<akpm@linux-foundation.org>; "Fabio Estevam"<festevam@gmail.com>; "Stephen Rothwell"<sfr@canb.auug.org.au>; "Rich Felker"<dalias@libc.org>; "Russell King"<linux@arm.linux.org.uk>; "Yoshinori Sato"<ysato@users.sourceforge.jp>; "linux-kernel"<linux-kernel@vger.kernel.org>; "Ralf Baechle"<ralf@linux-mips.org>; "linux-omap"<linux-omap@vger.kernel.org>; "James Hogan"<james.hogan@mips.com>; "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"<linux-arm-kernel@lists.infradead.org>;
Subject:  Re: Regression with arm in next with stack protector
 
* 陈华才 <chenhc@lemote.com> [180326 06:59]:
> Hi, Tony and Fabio,
> 
> Could you please upload your kernel binary to somewhere for me? I don't understand why some ARM boards is OK while others are broken.

Well the kernel I'm testing is just current Linux next cross
compiled omap2plus_defconfig kernel. I do have few more config
options enabled like LOCKDEP and DEBUG_ATOMIC_SLEEP, but I
doubt they matter here :)

Then I'm using gcc-7.3.0 and binutils-2.30 built with the
buildall.git scripts:

git://git.infradead.org/users/segher/buildall.git

If you still need binaries, let me know.

Do you know which arm devices are working with your patch?

Regards,

Tony

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
@ 2018-03-27  8:29           ` 陈华才
  0 siblings, 0 replies; 30+ messages in thread
From: 陈华才 @ 2018-03-27  8:29 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Stephen Rothwell, Rich Felker, Russell King, Yoshinori Sato,
	linux-kernel, Ralf Baechle, Andrew Morton, linux-omap,
	Fabio Estevam, James Hogan,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Allwinner devices are OK, Exynos devices (except 4210) are OK.
 
------------------ Original ------------------
From:  "Tony Lindgren"<tony@atomide.com>;
Date:  Mon, Mar 26, 2018 11:37 PM
To:  "陈华才"<chenhc@lemote.com>;
Cc:  "Andrew Morton"<akpm@linux-foundation.org>; "Fabio Estevam"<festevam@gmail.com>; "Stephen Rothwell"<sfr@canb.auug.org.au>; "Rich Felker"<dalias@libc.org>; "Russell King"<linux@arm.linux.org.uk>; "Yoshinori Sato"<ysato@users.sourceforge.jp>; "linux-kernel"<linux-kernel@vger.kernel.org>; "Ralf Baechle"<ralf@linux-mips.org>; "linux-omap"<linux-omap@vger.kernel.org>; "James Hogan"<james.hogan@mips.com>; "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"<linux-arm-kernel@lists.infradead.org>;
Subject:  Re: Regression with arm in next with stack protector
 
* 陈华才 <chenhc@lemote.com> [180326 06:59]:
> Hi, Tony and Fabio,
> 
> Could you please upload your kernel binary to somewhere for me? I don't understand why some ARM boards is OK while others are broken.

Well the kernel I'm testing is just current Linux next cross
compiled omap2plus_defconfig kernel. I do have few more config
options enabled like LOCKDEP and DEBUG_ATOMIC_SLEEP, but I
doubt they matter here :)

Then I'm using gcc-7.3.0 and binutils-2.30 built with the
buildall.git scripts:

git://git.infradead.org/users/segher/buildall.git

If you still need binaries, let me know.

Do you know which arm devices are working with your patch?

Regards,

Tony
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-27  8:29           ` 陈华才
  0 siblings, 0 replies; 30+ messages in thread
From: 陈华才 @ 2018-03-27  8:29 UTC (permalink / raw)
  To: linux-arm-kernel

Allwinner devices are OK, Exynos devices (except 4210) are OK.
 
------------------ Original ------------------
From:  "Tony Lindgren"<tony@atomide.com>;
Date:  Mon, Mar 26, 2018 11:37 PM
To:  "???"<chenhc@lemote.com>;
Cc:  "Andrew Morton"<akpm@linux-foundation.org>; "Fabio Estevam"<festevam@gmail.com>; "Stephen Rothwell"<sfr@canb.auug.org.au>; "Rich Felker"<dalias@libc.org>; "Russell King"<linux@arm.linux.org.uk>; "Yoshinori Sato"<ysato@users.sourceforge.jp>; "linux-kernel"<linux-kernel@vger.kernel.org>; "Ralf Baechle"<ralf@linux-mips.org>; "linux-omap"<linux-omap@vger.kernel.org>; "James Hogan"<james.hogan@mips.com>; "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"<linux-arm-kernel@lists.infradead.org>;
Subject:  Re: Regression with arm in next with stack protector
 
* ??? <chenhc@lemote.com> [180326 06:59]:
> Hi, Tony and Fabio,
> 
> Could you please upload your kernel binary to somewhere for me? I don't understand why some ARM boards is OK while others are broken.

Well the kernel I'm testing is just current Linux next cross
compiled omap2plus_defconfig kernel. I do have few more config
options enabled like LOCKDEP and DEBUG_ATOMIC_SLEEP, but I
doubt they matter here :)

Then I'm using gcc-7.3.0 and binutils-2.30 built with the
buildall.git scripts:

git://git.infradead.org/users/segher/buildall.git

If you still need binaries, let me know.

Do you know which arm devices are working with your patch?

Regards,

Tony

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-23 18:14 ` Tony Lindgren
@ 2018-03-27  9:04   ` Russell King - ARM Linux
  -1 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2018-03-27  9:04 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Huacai Chen, Andrew Morton, Stephen Rothwell, Ralf Baechle,
	James Hogan, Yoshinori Sato, Rich Felker, linux-kernel,
	linux-arm-kernel, linux-omap

On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> Hi,
> 
> Looks like commit 5638790dadae ("zboot: fix stack protector in
> compressed boot phase") breaks booting on arm.
> 
> This is all I get from the bootloader on omap3:
> 
> Starting kernel ...
> 
> data abort
> pc : [<810002d0>]          lr : [<100110a8>]
> reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> Resetting CPU ...
> 
> resetting ...

The reason for this is the following code that was introduced by the
referenced patch:

+               ldr     r0, =__stack_chk_guard
+               ldr     r1, =0x000a0dff
+               str     r1, [r0]

This uses the absolute address of __stack_chk_guard in the decompressor,
which is a self-relocatable image.  As with all constructs like the
above, this absolute address doesn't get fixed up, and so it ends up
pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
and the decompressor looks to be around 0x81000000.

Such constructs can not be used in the decompressor for exactly this
reason - they need to use PC-relative addressing instead just like
everything else does in head.S.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-27  9:04   ` Russell King - ARM Linux
  0 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2018-03-27  9:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> Hi,
> 
> Looks like commit 5638790dadae ("zboot: fix stack protector in
> compressed boot phase") breaks booting on arm.
> 
> This is all I get from the bootloader on omap3:
> 
> Starting kernel ...
> 
> data abort
> pc : [<810002d0>]          lr : [<100110a8>]
> reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> Resetting CPU ...
> 
> resetting ...

The reason for this is the following code that was introduced by the
referenced patch:

+               ldr     r0, =__stack_chk_guard
+               ldr     r1, =0x000a0dff
+               str     r1, [r0]

This uses the absolute address of __stack_chk_guard in the decompressor,
which is a self-relocatable image.  As with all constructs like the
above, this absolute address doesn't get fixed up, and so it ends up
pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
and the decompressor looks to be around 0x81000000.

Such constructs can not be used in the decompressor for exactly this
reason - they need to use PC-relative addressing instead just like
everything else does in head.S.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-27  9:04   ` Russell King - ARM Linux
@ 2018-03-27  9:11     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2018-03-27  9:11 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Stephen Rothwell, Rich Felker, Yoshinori Sato, linux-kernel,
	Ralf Baechle, linux-omap, Huacai Chen, Andrew Morton,
	James Hogan, linux-arm-kernel

On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > Hi,
> > 
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> > 
> > This is all I get from the bootloader on omap3:
> > 
> > Starting kernel ...
> > 
> > data abort
> > pc : [<810002d0>]          lr : [<100110a8>]
> > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > Resetting CPU ...
> > 
> > resetting ...
> 
> The reason for this is the following code that was introduced by the
> referenced patch:
> 
> +               ldr     r0, =__stack_chk_guard
> +               ldr     r1, =0x000a0dff
> +               str     r1, [r0]
> 
> This uses the absolute address of __stack_chk_guard in the decompressor,
> which is a self-relocatable image.  As with all constructs like the
> above, this absolute address doesn't get fixed up, and so it ends up
> pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> and the decompressor looks to be around 0x81000000.
> 
> Such constructs can not be used in the decompressor for exactly this
> reason - they need to use PC-relative addressing instead just like
> everything else does in head.S.

I guess someone's not going to see my message to correct their patch:

  chenhc@lemote.com
    SMTP error from remote mail server after end of data:
    host mxbiz1.qq.com [184.105.206.88]: 550 Mail content denied.
    http://service.exmail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-27  9:11     ` Russell King - ARM Linux
  0 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2018-03-27  9:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > Hi,
> > 
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> > 
> > This is all I get from the bootloader on omap3:
> > 
> > Starting kernel ...
> > 
> > data abort
> > pc : [<810002d0>]          lr : [<100110a8>]
> > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > Resetting CPU ...
> > 
> > resetting ...
> 
> The reason for this is the following code that was introduced by the
> referenced patch:
> 
> +               ldr     r0, =__stack_chk_guard
> +               ldr     r1, =0x000a0dff
> +               str     r1, [r0]
> 
> This uses the absolute address of __stack_chk_guard in the decompressor,
> which is a self-relocatable image.  As with all constructs like the
> above, this absolute address doesn't get fixed up, and so it ends up
> pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> and the decompressor looks to be around 0x81000000.
> 
> Such constructs can not be used in the decompressor for exactly this
> reason - they need to use PC-relative addressing instead just like
> everything else does in head.S.

I guess someone's not going to see my message to correct their patch:

  chenhc at lemote.com
    SMTP error from remote mail server after end of data:
    host mxbiz1.qq.com [184.105.206.88]: 550 Mail content denied.
    http://service.exmail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-27  9:04   ` Russell King - ARM Linux
@ 2018-03-27 11:34     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2018-03-27 11:34 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Stephen Rothwell, Rich Felker, Yoshinori Sato, linux-kernel,
	Ralf Baechle, linux-omap, Huacai Chen, Andrew Morton,
	James Hogan, linux-arm-kernel

On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > Hi,
> > 
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> > 
> > This is all I get from the bootloader on omap3:
> > 
> > Starting kernel ...
> > 
> > data abort
> > pc : [<810002d0>]          lr : [<100110a8>]
> > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > Resetting CPU ...
> > 
> > resetting ...
> 
> The reason for this is the following code that was introduced by the
> referenced patch:
> 
> +               ldr     r0, =__stack_chk_guard
> +               ldr     r1, =0x000a0dff
> +               str     r1, [r0]
> 
> This uses the absolute address of __stack_chk_guard in the decompressor,
> which is a self-relocatable image.  As with all constructs like the
> above, this absolute address doesn't get fixed up, and so it ends up
> pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> and the decompressor looks to be around 0x81000000.
> 
> Such constructs can not be used in the decompressor for exactly this
> reason - they need to use PC-relative addressing instead just like
> everything else does in head.S.

Is there any reason we can't do this in misc.c:

const unsigned int __stack_chk_guard = 0x000a0dff;

?  That would save having runtime code to set that value up, and after
all, it is constant.  Arguments about it potentially ending up at a
fixed offset into the image need not be said - that's already the case
with placing it in the early assembly code, and as has been established,
it needs to be initialised prior to any C code being called.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-27 11:34     ` Russell King - ARM Linux
  0 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2018-03-27 11:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > Hi,
> > 
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> > 
> > This is all I get from the bootloader on omap3:
> > 
> > Starting kernel ...
> > 
> > data abort
> > pc : [<810002d0>]          lr : [<100110a8>]
> > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > Resetting CPU ...
> > 
> > resetting ...
> 
> The reason for this is the following code that was introduced by the
> referenced patch:
> 
> +               ldr     r0, =__stack_chk_guard
> +               ldr     r1, =0x000a0dff
> +               str     r1, [r0]
> 
> This uses the absolute address of __stack_chk_guard in the decompressor,
> which is a self-relocatable image.  As with all constructs like the
> above, this absolute address doesn't get fixed up, and so it ends up
> pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> and the decompressor looks to be around 0x81000000.
> 
> Such constructs can not be used in the decompressor for exactly this
> reason - they need to use PC-relative addressing instead just like
> everything else does in head.S.

Is there any reason we can't do this in misc.c:

const unsigned int __stack_chk_guard = 0x000a0dff;

?  That would save having runtime code to set that value up, and after
all, it is constant.  Arguments about it potentially ending up at a
fixed offset into the image need not be said - that's already the case
with placing it in the early assembly code, and as has been established,
it needs to be initialised prior to any C code being called.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-27  9:04   ` Russell King - ARM Linux
@ 2018-03-27 15:35     ` Rich Felker
  -1 siblings, 0 replies; 30+ messages in thread
From: Rich Felker @ 2018-03-27 15:35 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, Huacai Chen, Andrew Morton, Stephen Rothwell,
	Ralf Baechle, James Hogan, Yoshinori Sato, linux-kernel,
	linux-arm-kernel, linux-omap

On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > Hi,
> > 
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> > 
> > This is all I get from the bootloader on omap3:
> > 
> > Starting kernel ...
> > 
> > data abort
> > pc : [<810002d0>]          lr : [<100110a8>]
> > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > Resetting CPU ...
> > 
> > resetting ...
> 
> The reason for this is the following code that was introduced by the
> referenced patch:
> 
> +               ldr     r0, =__stack_chk_guard
> +               ldr     r1, =0x000a0dff
> +               str     r1, [r0]
> 
> This uses the absolute address of __stack_chk_guard in the decompressor,
> which is a self-relocatable image.  As with all constructs like the
> above, this absolute address doesn't get fixed up, and so it ends up
> pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> and the decompressor looks to be around 0x81000000.
> 
> Such constructs can not be used in the decompressor for exactly this
> reason - they need to use PC-relative addressing instead just like
> everything else does in head.S.

Can someone please answer why this is even needed to begin with? I
don't see any compelling reason __stack_chk_guard needs a particular
value in the decompressor, which is not dealing with any non-constant
input. Just putting __stack_chk_guard in its bss should be fine and
would eliminate all the risks of wrong code to load a value into it.
Alternatively put it in initialized data with the desired value.

Rich

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-27 15:35     ` Rich Felker
  0 siblings, 0 replies; 30+ messages in thread
From: Rich Felker @ 2018-03-27 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > Hi,
> > 
> > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > compressed boot phase") breaks booting on arm.
> > 
> > This is all I get from the bootloader on omap3:
> > 
> > Starting kernel ...
> > 
> > data abort
> > pc : [<810002d0>]          lr : [<100110a8>]
> > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > Resetting CPU ...
> > 
> > resetting ...
> 
> The reason for this is the following code that was introduced by the
> referenced patch:
> 
> +               ldr     r0, =__stack_chk_guard
> +               ldr     r1, =0x000a0dff
> +               str     r1, [r0]
> 
> This uses the absolute address of __stack_chk_guard in the decompressor,
> which is a self-relocatable image.  As with all constructs like the
> above, this absolute address doesn't get fixed up, and so it ends up
> pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> and the decompressor looks to be around 0x81000000.
> 
> Such constructs can not be used in the decompressor for exactly this
> reason - they need to use PC-relative addressing instead just like
> everything else does in head.S.

Can someone please answer why this is even needed to begin with? I
don't see any compelling reason __stack_chk_guard needs a particular
value in the decompressor, which is not dealing with any non-constant
input. Just putting __stack_chk_guard in its bss should be fine and
would eliminate all the risks of wrong code to load a value into it.
Alternatively put it in initialized data with the desired value.

Rich

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-27 11:34     ` Russell King - ARM Linux
@ 2018-03-27 15:36       ` Rich Felker
  -1 siblings, 0 replies; 30+ messages in thread
From: Rich Felker @ 2018-03-27 15:36 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, Stephen Rothwell, Yoshinori Sato, linux-kernel,
	Ralf Baechle, linux-omap, Huacai Chen, Andrew Morton,
	James Hogan, linux-arm-kernel

On Tue, Mar 27, 2018 at 12:34:53PM +0100, Russell King - ARM Linux wrote:
> On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> > On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > > Hi,
> > > 
> > > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > > compressed boot phase") breaks booting on arm.
> > > 
> > > This is all I get from the bootloader on omap3:
> > > 
> > > Starting kernel ...
> > > 
> > > data abort
> > > pc : [<810002d0>]          lr : [<100110a8>]
> > > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > > Resetting CPU ...
> > > 
> > > resetting ...
> > 
> > The reason for this is the following code that was introduced by the
> > referenced patch:
> > 
> > +               ldr     r0, =__stack_chk_guard
> > +               ldr     r1, =0x000a0dff
> > +               str     r1, [r0]
> > 
> > This uses the absolute address of __stack_chk_guard in the decompressor,
> > which is a self-relocatable image.  As with all constructs like the
> > above, this absolute address doesn't get fixed up, and so it ends up
> > pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> > and the decompressor looks to be around 0x81000000.
> > 
> > Such constructs can not be used in the decompressor for exactly this
> > reason - they need to use PC-relative addressing instead just like
> > everything else does in head.S.
> 
> Is there any reason we can't do this in misc.c:
> 
> const unsigned int __stack_chk_guard = 0x000a0dff;
> 
> ?  That would save having runtime code to set that value up, and after
> all, it is constant.  Arguments about it potentially ending up at a
> fixed offset into the image need not be said - that's already the case
> with placing it in the early assembly code, and as has been established,
> it needs to be initialised prior to any C code being called.

I've asked this multiple times in this thread and as far as I know
nobody has answered.

Rich

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-27 15:36       ` Rich Felker
  0 siblings, 0 replies; 30+ messages in thread
From: Rich Felker @ 2018-03-27 15:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 27, 2018 at 12:34:53PM +0100, Russell King - ARM Linux wrote:
> On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> > On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > > Hi,
> > > 
> > > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > > compressed boot phase") breaks booting on arm.
> > > 
> > > This is all I get from the bootloader on omap3:
> > > 
> > > Starting kernel ...
> > > 
> > > data abort
> > > pc : [<810002d0>]          lr : [<100110a8>]
> > > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > > Resetting CPU ...
> > > 
> > > resetting ...
> > 
> > The reason for this is the following code that was introduced by the
> > referenced patch:
> > 
> > +               ldr     r0, =__stack_chk_guard
> > +               ldr     r1, =0x000a0dff
> > +               str     r1, [r0]
> > 
> > This uses the absolute address of __stack_chk_guard in the decompressor,
> > which is a self-relocatable image.  As with all constructs like the
> > above, this absolute address doesn't get fixed up, and so it ends up
> > pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> > and the decompressor looks to be around 0x81000000.
> > 
> > Such constructs can not be used in the decompressor for exactly this
> > reason - they need to use PC-relative addressing instead just like
> > everything else does in head.S.
> 
> Is there any reason we can't do this in misc.c:
> 
> const unsigned int __stack_chk_guard = 0x000a0dff;
> 
> ?  That would save having runtime code to set that value up, and after
> all, it is constant.  Arguments about it potentially ending up at a
> fixed offset into the image need not be said - that's already the case
> with placing it in the early assembly code, and as has been established,
> it needs to be initialised prior to any C code being called.

I've asked this multiple times in this thread and as far as I know
nobody has answered.

Rich

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-27 15:35     ` Rich Felker
@ 2018-03-27 17:20       ` Russell King - ARM Linux
  -1 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2018-03-27 17:20 UTC (permalink / raw)
  To: Rich Felker
  Cc: Tony Lindgren, Huacai Chen, Andrew Morton, Stephen Rothwell,
	Ralf Baechle, James Hogan, Yoshinori Sato, linux-kernel,
	linux-arm-kernel, linux-omap

On Tue, Mar 27, 2018 at 11:35:25AM -0400, Rich Felker wrote:
> On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> > On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > > Hi,
> > > 
> > > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > > compressed boot phase") breaks booting on arm.
> > > 
> > > This is all I get from the bootloader on omap3:
> > > 
> > > Starting kernel ...
> > > 
> > > data abort
> > > pc : [<810002d0>]          lr : [<100110a8>]
> > > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > > Resetting CPU ...
> > > 
> > > resetting ...
> > 
> > The reason for this is the following code that was introduced by the
> > referenced patch:
> > 
> > +               ldr     r0, =__stack_chk_guard
> > +               ldr     r1, =0x000a0dff
> > +               str     r1, [r0]
> > 
> > This uses the absolute address of __stack_chk_guard in the decompressor,
> > which is a self-relocatable image.  As with all constructs like the
> > above, this absolute address doesn't get fixed up, and so it ends up
> > pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> > and the decompressor looks to be around 0x81000000.
> > 
> > Such constructs can not be used in the decompressor for exactly this
> > reason - they need to use PC-relative addressing instead just like
> > everything else does in head.S.
> 
> Can someone please answer why this is even needed to begin with? I
> don't see any compelling reason __stack_chk_guard needs a particular
> value in the decompressor, which is not dealing with any non-constant
> input.

Untrue - it can do some parsing of the DT and updating/appending
information from ATAGs.  However, all that should be coming from
a trusted environment, so I don't see much of a "trust" issue here.
(If the parent environment is not trusted, then the environment we're
running in is not trusted.)

> Just putting __stack_chk_guard in its bss should be fine and
> would eliminate all the risks of wrong code to load a value into it.
> Alternatively put it in initialized data with the desired value.

I'm no expert with this, so I can't comment.  I build my kernels
with gcc 4.7.4, which I don't think supports this feature.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-27 17:20       ` Russell King - ARM Linux
  0 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2018-03-27 17:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 27, 2018 at 11:35:25AM -0400, Rich Felker wrote:
> On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> > On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > > Hi,
> > > 
> > > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > > compressed boot phase") breaks booting on arm.
> > > 
> > > This is all I get from the bootloader on omap3:
> > > 
> > > Starting kernel ...
> > > 
> > > data abort
> > > pc : [<810002d0>]          lr : [<100110a8>]
> > > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > > Resetting CPU ...
> > > 
> > > resetting ...
> > 
> > The reason for this is the following code that was introduced by the
> > referenced patch:
> > 
> > +               ldr     r0, =__stack_chk_guard
> > +               ldr     r1, =0x000a0dff
> > +               str     r1, [r0]
> > 
> > This uses the absolute address of __stack_chk_guard in the decompressor,
> > which is a self-relocatable image.  As with all constructs like the
> > above, this absolute address doesn't get fixed up, and so it ends up
> > pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> > and the decompressor looks to be around 0x81000000.
> > 
> > Such constructs can not be used in the decompressor for exactly this
> > reason - they need to use PC-relative addressing instead just like
> > everything else does in head.S.
> 
> Can someone please answer why this is even needed to begin with? I
> don't see any compelling reason __stack_chk_guard needs a particular
> value in the decompressor, which is not dealing with any non-constant
> input.

Untrue - it can do some parsing of the DT and updating/appending
information from ATAGs.  However, all that should be coming from
a trusted environment, so I don't see much of a "trust" issue here.
(If the parent environment is not trusted, then the environment we're
running in is not trusted.)

> Just putting __stack_chk_guard in its bss should be fine and
> would eliminate all the risks of wrong code to load a value into it.
> Alternatively put it in initialized data with the desired value.

I'm no expert with this, so I can't comment.  I build my kernels
with gcc 4.7.4, which I don't think supports this feature.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Regression with arm in next with stack protector
  2018-03-27 17:20       ` Russell King - ARM Linux
@ 2018-03-27 17:27         ` Rich Felker
  -1 siblings, 0 replies; 30+ messages in thread
From: Rich Felker @ 2018-03-27 17:27 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, Huacai Chen, Andrew Morton, Stephen Rothwell,
	Ralf Baechle, James Hogan, Yoshinori Sato, linux-kernel,
	linux-arm-kernel, linux-omap

On Tue, Mar 27, 2018 at 06:20:27PM +0100, Russell King - ARM Linux wrote:
> On Tue, Mar 27, 2018 at 11:35:25AM -0400, Rich Felker wrote:
> > On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> > > On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > > > Hi,
> > > > 
> > > > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > > > compressed boot phase") breaks booting on arm.
> > > > 
> > > > This is all I get from the bootloader on omap3:
> > > > 
> > > > Starting kernel ...
> > > > 
> > > > data abort
> > > > pc : [<810002d0>]          lr : [<100110a8>]
> > > > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > > > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > > > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > > > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > > > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > > > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > > > Resetting CPU ...
> > > > 
> > > > resetting ...
> > > 
> > > The reason for this is the following code that was introduced by the
> > > referenced patch:
> > > 
> > > +               ldr     r0, =__stack_chk_guard
> > > +               ldr     r1, =0x000a0dff
> > > +               str     r1, [r0]
> > > 
> > > This uses the absolute address of __stack_chk_guard in the decompressor,
> > > which is a self-relocatable image.  As with all constructs like the
> > > above, this absolute address doesn't get fixed up, and so it ends up
> > > pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> > > and the decompressor looks to be around 0x81000000.
> > > 
> > > Such constructs can not be used in the decompressor for exactly this
> > > reason - they need to use PC-relative addressing instead just like
> > > everything else does in head.S.
> > 
> > Can someone please answer why this is even needed to begin with? I
> > don't see any compelling reason __stack_chk_guard needs a particular
> > value in the decompressor, which is not dealing with any non-constant
> > input.
> 
> Untrue - it can do some parsing of the DT and updating/appending
> information from ATAGs.  However, all that should be coming from
> a trusted environment, so I don't see much of a "trust" issue here.
> (If the parent environment is not trusted, then the environment we're
> running in is not trusted.)

OK, I was considering DT constant, but it doesn't really matter as you
say since the input comes from a trusted environment and could subvert
the system in much more direct ways than blowing away the
decompressor's stack buffers if it wanted to.

> > Just putting __stack_chk_guard in its bss should be fine and
> > would eliminate all the risks of wrong code to load a value into it.
> > Alternatively put it in initialized data with the desired value.
> 
> I'm no expert with this, so I can't comment.  I build my kernels
> with gcc 4.7.4, which I don't think supports this feature.

By "this feature" do you mean stack protector? I still have a 4.7.3
for x86 around and -fstack-protector-all works fine on it. Not sure if
there are issues using stack protector with kernel, or on ARM, for
older GCCs. In any case defining __stack_chk_guard as initialized data
should work on any gcc version regardless of whether stack protector
is actually used; it doesn't require any compiler features just basic
C.

Rich

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Regression with arm in next with stack protector
@ 2018-03-27 17:27         ` Rich Felker
  0 siblings, 0 replies; 30+ messages in thread
From: Rich Felker @ 2018-03-27 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 27, 2018 at 06:20:27PM +0100, Russell King - ARM Linux wrote:
> On Tue, Mar 27, 2018 at 11:35:25AM -0400, Rich Felker wrote:
> > On Tue, Mar 27, 2018 at 10:04:10AM +0100, Russell King - ARM Linux wrote:
> > > On Fri, Mar 23, 2018 at 11:14:53AM -0700, Tony Lindgren wrote:
> > > > Hi,
> > > > 
> > > > Looks like commit 5638790dadae ("zboot: fix stack protector in
> > > > compressed boot phase") breaks booting on arm.
> > > > 
> > > > This is all I get from the bootloader on omap3:
> > > > 
> > > > Starting kernel ...
> > > > 
> > > > data abort
> > > > pc : [<810002d0>]          lr : [<100110a8>]
> > > > reloc pc : [<9d6002d0>]    lr : [<2c6110a8>]
> > > > sp : 81467c18  ip : 81466bf0     fp : 81466bf0
> > > > r10: 80fc2c40  r9 : 81000258     r8 : 86fec000
> > > > r7 : ffffffff  r6 : 81466bf8     r5 : 00000000  r4 : 80008000
> > > > r3 : 81466c14  r2 : 81466c18     r1 : 000a0dff  r0 : 00466bf8
> > > > Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> > > > Resetting CPU ...
> > > > 
> > > > resetting ...
> > > 
> > > The reason for this is the following code that was introduced by the
> > > referenced patch:
> > > 
> > > +               ldr     r0, =__stack_chk_guard
> > > +               ldr     r1, =0x000a0dff
> > > +               str     r1, [r0]
> > > 
> > > This uses the absolute address of __stack_chk_guard in the decompressor,
> > > which is a self-relocatable image.  As with all constructs like the
> > > above, this absolute address doesn't get fixed up, and so it ends up
> > > pointing at invalid memory (in this case 0x466bf8) vs RAM at 0x80000000,
> > > and the decompressor looks to be around 0x81000000.
> > > 
> > > Such constructs can not be used in the decompressor for exactly this
> > > reason - they need to use PC-relative addressing instead just like
> > > everything else does in head.S.
> > 
> > Can someone please answer why this is even needed to begin with? I
> > don't see any compelling reason __stack_chk_guard needs a particular
> > value in the decompressor, which is not dealing with any non-constant
> > input.
> 
> Untrue - it can do some parsing of the DT and updating/appending
> information from ATAGs.  However, all that should be coming from
> a trusted environment, so I don't see much of a "trust" issue here.
> (If the parent environment is not trusted, then the environment we're
> running in is not trusted.)

OK, I was considering DT constant, but it doesn't really matter as you
say since the input comes from a trusted environment and could subvert
the system in much more direct ways than blowing away the
decompressor's stack buffers if it wanted to.

> > Just putting __stack_chk_guard in its bss should be fine and
> > would eliminate all the risks of wrong code to load a value into it.
> > Alternatively put it in initialized data with the desired value.
> 
> I'm no expert with this, so I can't comment.  I build my kernels
> with gcc 4.7.4, which I don't think supports this feature.

By "this feature" do you mean stack protector? I still have a 4.7.3
for x86 around and -fstack-protector-all works fine on it. Not sure if
there are issues using stack protector with kernel, or on ARM, for
older GCCs. In any case defining __stack_chk_guard as initialized data
should work on any gcc version regardless of whether stack protector
is actually used; it doesn't require any compiler features just basic
C.

Rich

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2018-03-27 17:28 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-23 18:14 Regression with arm in next with stack protector Tony Lindgren
2018-03-23 18:14 ` Tony Lindgren
2018-03-23 18:45 ` Fabio Estevam
2018-03-23 18:45   ` Fabio Estevam
2018-03-23 19:15   ` Andrew Morton
2018-03-23 19:15     ` Andrew Morton
2018-03-23 22:31     ` Stephen Rothwell
2018-03-23 22:31       ` Stephen Rothwell
2018-03-26  6:57     ` 陈华才
2018-03-26  6:57       ` 陈华才
2018-03-26  6:57       ` 陈华才
2018-03-26 15:37       ` Tony Lindgren
2018-03-26 15:37         ` Tony Lindgren
2018-03-27  8:29         ` 陈华才
2018-03-27  8:29           ` 陈华才
2018-03-27  8:29           ` 陈华才
2018-03-27  9:04 ` Russell King - ARM Linux
2018-03-27  9:04   ` Russell King - ARM Linux
2018-03-27  9:11   ` Russell King - ARM Linux
2018-03-27  9:11     ` Russell King - ARM Linux
2018-03-27 11:34   ` Russell King - ARM Linux
2018-03-27 11:34     ` Russell King - ARM Linux
2018-03-27 15:36     ` Rich Felker
2018-03-27 15:36       ` Rich Felker
2018-03-27 15:35   ` Rich Felker
2018-03-27 15:35     ` Rich Felker
2018-03-27 17:20     ` Russell King - ARM Linux
2018-03-27 17:20       ` Russell King - ARM Linux
2018-03-27 17:27       ` Rich Felker
2018-03-27 17:27         ` Rich Felker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.