Skip to contentSkip to conversation

"Failed to create /dev/root: -14" after commit e6978e4bf1 ("ARM: save and reset the address limit when entering an exception")

DISCUSSION Guenter Roeck 4 participants 9 messages Aug 3, 2016 – Aug 11, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

Hi,

I see the following crash when running a qemu arm 'kzm' runtime test with the current mainline.

Failed to create /dev/root: -14

[ followed by panic ]

A complete log file is at [1].

Bisect points to commit e6978e4bf1 ("ARM: save and reset the address limit when entering an exception"). Some additional debugging shows lots of similar error returns from strncpy_from_user(). For the error case resulting in the crash, the call chain is as follows.

sys_mknod
sys_mknodat()
user_path_create()
getname()
getname_flags()
strncpy_from_user()

Reverting the patch fixes the problem.

I don't see the problem with any other qemu arm test.

It looks like the kernel runs in exception context. My gut feeling is that qemu may be to blame, but I am not really sure.

Any idea how to track this down ?

Thanks,
Guenter

---
[1] http://kerneltests.org/builders/qemu-arm-master/builds/615

#1 lore raw
Quoted 10 lines · Guenter Roeck

Hi,

I see the following crash when running a qemu arm 'kzm' runtime test with the current mainline.
...
Failed to create /dev/root: -14

[ followed by panic ]

A complete log file is at [1].

I think it's because of those undefined instructions you're hitting with the hw-breakpoint code... can you try the patch below please?

 arch/arm/kernel/entry-armv.S | 1 +
 1 file changed, 1 insertion(+)
arch/arm/kernel/entry-armv.S +1 -0
index bc5f50799d75..9f157e7c51e7 100644
@@ -295,6 +295,7 @@ __und_svc_fault:
 	bl	__und_fault
 
 __und_svc_finish:
+	get_thread_info tsk
 	ldr	r5, [sp, #S_PSR]		@ Get SVC cpsr
 	svc_exit r5				@ return from exception
  UNWIND(.fnend		)
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
author Tested-by
#2 lore raw
Quoted 24 lines · Russell King - ARM Linux
Quoted 10 lines · Guenter Roeck

Hi,

I see the following crash when running a qemu arm 'kzm' runtime test with the current mainline.
...
Failed to create /dev/root: -14

[ followed by panic ]

A complete log file is at [1].

I think it's because of those undefined instructions you're hitting with the hw-breakpoint code... can you try the patch below please?

  arch/arm/kernel/entry-armv.S | 1 +
  1 file changed, 1 insertion(+)
arch/arm/kernel/entry-armv.S +0 -0
index bc5f50799d75..9f157e7c51e7 100644

arch/arm/kernel/entry-armv.S __und_svc_fault: · line 301

Quoted 7 lines
arch/arm/kernel/entry-armv.S +1 -0
@@ -295,6 +295,7 @@ __und_svc_fault:
  	bl	__und_fault
 
  __und_svc_finish:
+	get_thread_info tsk
  	ldr	r5, [sp, #S_PSR]		@ Get SVC cpsr
  	svc_exit r5				@ return from exception
   UNWIND(.fnend		)

Yes, that fixes the problem.

Assuming you'll create a patch:

Does that need to be addressed in qemu, or is it a Linux bug ?

Thanks,
Guenter

#3 lore raw
Quoted 35 lines · Guenter Roeck
Quoted 24 lines · Russell King - ARM Linux
Quoted 10 lines · Guenter Roeck

Hi,

I see the following crash when running a qemu arm 'kzm' runtime test with the current mainline.
...
Failed to create /dev/root: -14

[ followed by panic ]

A complete log file is at [1].

I think it's because of those undefined instructions you're hitting with the hw-breakpoint code... can you try the patch below please?

 arch/arm/kernel/entry-armv.S | 1 +
 1 file changed, 1 insertion(+)
arch/arm/kernel/entry-armv.S +0 -0
index bc5f50799d75..9f157e7c51e7 100644

arch/arm/kernel/entry-armv.S __und_svc_fault: · line 301

Quoted 7 lines
arch/arm/kernel/entry-armv.S +1 -0
@@ -295,6 +295,7 @@ __und_svc_fault:
 	bl	__und_fault
 
 __und_svc_finish:
+	get_thread_info tsk
 	ldr	r5, [sp, #S_PSR]		@ Get SVC cpsr
 	svc_exit r5				@ return from exception
  UNWIND(.fnend		)

Yes, that fixes the problem.

Quoted 5 lines

Assuming you'll create a patch:

Does that need to be addressed in qemu, or is it a Linux bug ?

It's a Linux bug provoked by qemu not implementing the hardware breakpoints. Well worth fixing in Linux.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
Tested-by
#4 lore raw

Hi Russell King,

Quoted 36 lines · Russell King - ARM Linux
Quoted 35 lines · Guenter Roeck
Quoted 24 lines · Russell King - ARM Linux
Quoted 10 lines · Guenter Roeck

Hi,

I see the following crash when running a qemu arm 'kzm' runtime test with the current mainline.
...
Failed to create /dev/root: -14

[ followed by panic ]

A complete log file is at [1].

I think it's because of those undefined instructions you're hitting with the hw-breakpoint code... can you try the patch below please?

 arch/arm/kernel/entry-armv.S | 1 +
 1 file changed, 1 insertion(+)
arch/arm/kernel/entry-armv.S +0 -0
index bc5f50799d75..9f157e7c51e7 100644

arch/arm/kernel/entry-armv.S __und_svc_fault: · line 301

Quoted 7 lines
arch/arm/kernel/entry-armv.S +1 -0
@@ -295,6 +295,7 @@ __und_svc_fault:
 	bl	__und_fault
 
 __und_svc_finish:
+	get_thread_info tsk
 	ldr	r5, [sp, #S_PSR]		@ Get SVC cpsr
 	svc_exit r5				@ return from exception
  UNWIND(.fnend		)

Yes, that fixes the problem.

Quoted 8 lines
Quoted 5 lines

Assuming you'll create a patch:

Does that need to be addressed in qemu, or is it a Linux bug ?

It's a Linux bug provoked by qemu not implementing the hardware breakpoints. Well worth fixing in Linux.

The Armada XP base platform were hit by the same bug as we can see on kernlci:
https://storage.kernelci.org/mainline/v4.8-rc1/arm-mvebu_v7_defconfig/lab-baylibre-seattle/boot-armada-xp-openblocks-ax3-4.html

Your patch solves the issue too.

Will you push this patch for v4.8-rc2 ?

Also I wonder if it is something expected to have this issue on a "real" hardware.

You can also add my:

Thanks,

Gregory

Quoted 10 lines
Signature · 9 lines
-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw
Quoted 53 lines · Gregory CLEMENT

Hi Russell King,

Quoted 36 lines · Russell King - ARM Linux
Quoted 35 lines · Guenter Roeck
Quoted 24 lines · Russell King - ARM Linux
Quoted 10 lines · Guenter Roeck

Hi,

I see the following crash when running a qemu arm 'kzm' runtime test with the current mainline.
...
Failed to create /dev/root: -14

[ followed by panic ]

A complete log file is at [1].

I think it's because of those undefined instructions you're hitting with the hw-breakpoint code... can you try the patch below please?

 arch/arm/kernel/entry-armv.S | 1 +
 1 file changed, 1 insertion(+)
arch/arm/kernel/entry-armv.S +0 -0
index bc5f50799d75..9f157e7c51e7 100644

arch/arm/kernel/entry-armv.S __und_svc_fault: · line 301

Quoted 7 lines
arch/arm/kernel/entry-armv.S +1 -0
@@ -295,6 +295,7 @@ __und_svc_fault:
 	bl	__und_fault
 
 __und_svc_finish:
+	get_thread_info tsk
 	ldr	r5, [sp, #S_PSR]		@ Get SVC cpsr
 	svc_exit r5				@ return from exception
  UNWIND(.fnend		)

Yes, that fixes the problem.

Quoted 8 lines
Quoted 5 lines

Assuming you'll create a patch:

Does that need to be addressed in qemu, or is it a Linux bug ?

It's a Linux bug provoked by qemu not implementing the hardware breakpoints. Well worth fixing in Linux.

The Armada XP base platform were hit by the same bug as we can see on kernlci:
https://storage.kernelci.org/mainline/v4.8-rc1/arm-mvebu_v7_defconfig/lab-baylibre-seattle/boot-armada-xp-openblocks-ax3-4.html

Quoted 7 lines

Your patch solves the issue too.

Will you push this patch for v4.8-rc2 ?

Also I wonder if it is something expected to have this issue on a "real" hardware.

It would be expected if hardware breakpoint implementation is optional and not all real CPUs implement it.

Guenter

Tested-by
#6 lore raw
In reply to Gregory CLEMENT
Quoted 55 lines · Gregory CLEMENT

Hi Russell King,

Quoted 36 lines · Russell King - ARM Linux
Quoted 35 lines · Guenter Roeck
Quoted 24 lines · Russell King - ARM Linux
Quoted 10 lines · Guenter Roeck

Hi,

I see the following crash when running a qemu arm 'kzm' runtime test with the current mainline.
...
Failed to create /dev/root: -14

[ followed by panic ]

A complete log file is at [1].

I think it's because of those undefined instructions you're hitting with the hw-breakpoint code... can you try the patch below please?

 arch/arm/kernel/entry-armv.S | 1 +
 1 file changed, 1 insertion(+)
arch/arm/kernel/entry-armv.S +0 -0
index bc5f50799d75..9f157e7c51e7 100644

arch/arm/kernel/entry-armv.S __und_svc_fault: · line 301

Quoted 7 lines
arch/arm/kernel/entry-armv.S +1 -0
@@ -295,6 +295,7 @@ __und_svc_fault:
   bl      __und_fault
 
 __und_svc_finish:
+   get_thread_info tsk
   ldr     r5, [sp, #S_PSR]                @ Get SVC cpsr
   svc_exit r5                             @ return from exception
  UNWIND(.fnend            )

Yes, that fixes the problem.

Quoted 8 lines
Quoted 5 lines

Assuming you'll create a patch:

Does that need to be addressed in qemu, or is it a Linux bug ?

It's a Linux bug provoked by qemu not implementing the hardware breakpoints. Well worth fixing in Linux.

The Armada XP base platform were hit by the same bug as we can see on kernlci:
https://storage.kernelci.org/mainline/v4.8-rc1/arm-mvebu_v7_defconfig/lab-baylibre-seattle/boot-armada-xp-openblocks-ax3-4.html

Your patch solves the issue too.

Quoted 7 lines

Will you push this patch for v4.8-rc2 ?

Also I wonder if it is something expected to have this issue on a "real" hardware.

You can also add my:

I also tested this fixes the boot issue on Armada XP.

Kevin

#7 lore raw
Quoted 3 lines · Kevin Hilman

I also tested this fixes the boot issue on Armada XP.

It should be in the current linux-next. I'll send them on in the usual way over the weekend for -rc2, with your ack for this one.

Thanks.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
#8 lore raw
Quoted 7 lines · Russell King - ARM Linux
Quoted 3 lines · Kevin Hilman

I also tested this fixes the boot issue on Armada XP.

It should be in the current linux-next. I'll send them on in the usual way over the weekend for -rc2, with your ack for this one.

Also, I noticed your for-next branch is going through boot testing right now in my kernelci lab, and I see it passed on the Armada XP, so that's more evidence for the fix.

Thanks,

Kevin