Skip to contentSkip to conversation

parisc architecture fixes for 4.15-rc7

GIT PULL Helge Deller 2 participants 5 messages Jan 7, 2018 – Jan 12, 2018 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

Hi Linus,

please pull a few fixes for the parisc architecture from:

git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git parisc-4.15-3

The fixes are:
- Many small fixes to show the real physical addresses of devices instead of hashed addresses.

- One important fix to unbreak 32-bit SMP support: We forgot to 16-byte align the spinlocks in the assembler code.

- Qemu support: The host will get a chance to sleep when the parisc guest is idle. We use the same mechanism as the power architecture by overlaying the "or %r10,%r10,%r10" instruction which is simply a nop on real hardware.

Thanks,
Helge

----------------------------------------------------------------
Helge Deller (6):
parisc: Show unhashed hardware inventory
parisc: Show initial kernel memory layout unhashed
parisc: Show unhashed HPA of Dino chip
parisc: Show unhashed EISA EEPROM address
parisc: Fix alignment of pa_tlb_lock in assembly on 32-bit SMP kernel
parisc: qemu idle sleep support

 arch/parisc/include/asm/ldcw.h |  2 ++
 arch/parisc/kernel/drivers.c   |  2 +-
 arch/parisc/kernel/entry.S     | 13 +++++++++++--
 arch/parisc/kernel/pacache.S   |  9 +++++++--
 arch/parisc/kernel/process.c   | 39 +++++++++++++++++++++++++++++++++++++++
 arch/parisc/mm/init.c          | 10 +++++-----
 drivers/parisc/dino.c          | 10 +++++-----
 drivers/parisc/eisa_eeprom.c   |  2 +-
 8 files changed, 71 insertions(+), 16 deletions(-)
#1 lore raw
Quoted 17 lines · Helge Deller

Hi Linus,

please pull a few fixes for the parisc architecture from:

git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git parisc-4.15-3

The fixes are:
- Many small fixes to show the real physical addresses of devices instead of hashed addresses.

- One important fix to unbreak 32-bit SMP support: We forgot to 16-byte align the spinlocks in the assembler code.

- Qemu support: The host will get a chance to sleep when the parisc guest is idle. We use the same mechanism as the power architecture by overlaying the "or %r10,%r10,%r10" instruction which is simply a nop on real hardware.

Quoted 7 lines

Thanks,
Helge

----------------------------------------------------------------
Helge Deller (6):
parisc: Show unhashed hardware inventory
parisc: Show unhashed EISA EEPROM address

These looks like a physical addresses, yes.

Quoted 2 lines

parisc: Show initial kernel memory layout unhashed
parisc: Show unhashed HPA of Dino chip

But these are virtual addresses and should be just removed, not switched to %px. They're not physical addresses that I can see, e.g. "dino_dev" is clearly being used as an in-memory structure, and the kernel layout literally says "virtual kernel memory layout". Especially the kernel memory layout going to dmesg should be removed. That kind of thing has been entirely removed from other architectures (or will be soon[1]). See commit adb1fe9ae2ee ("mm/page_alloc: Remove kernel address exposure in free_reserved_area()"). (Also note that hiding behind CONFIG_DEBUG_KERNEL is not sufficient: most distros build with that config.)

-Kees

[1] https://www.spinics.net/lists/arm-kernel/msg624390.html

Quoted 12 lines

parisc: Fix alignment of pa_tlb_lock in assembly on 32-bit SMP kernel
parisc: qemu idle sleep support

 arch/parisc/include/asm/ldcw.h |  2 ++
 arch/parisc/kernel/drivers.c   |  2 +-
 arch/parisc/kernel/entry.S     | 13 +++++++++++--
 arch/parisc/kernel/pacache.S   |  9 +++++++--
 arch/parisc/kernel/process.c   | 39 +++++++++++++++++++++++++++++++++++++++
 arch/parisc/mm/init.c          | 10 +++++-----
 drivers/parisc/dino.c          | 10 +++++-----
 drivers/parisc/eisa_eeprom.c   |  2 +-
 8 files changed, 71 insertions(+), 16 deletions(-)
Signature · 2 lines
Kees Cook
Pixel Security
author maintainer
#2 lore raw
Quoted 28 lines · Kees Cook
Quoted 17 lines · Helge Deller

Hi Linus,

please pull a few fixes for the parisc architecture from:

git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git parisc-4.15-3

The fixes are:
- Many small fixes to show the real physical addresses of devices instead of hashed addresses.

- One important fix to unbreak 32-bit SMP support: We forgot to 16-byte align the spinlocks in the assembler code.

- Qemu support: The host will get a chance to sleep when the parisc guest is idle. We use the same mechanism as the power architecture by overlaying the "or %r10,%r10,%r10" instruction which is simply a nop on real hardware.

Quoted 7 lines

Thanks,
Helge

----------------------------------------------------------------
Helge Deller (6):
parisc: Show unhashed hardware inventory
parisc: Show unhashed EISA EEPROM address

These looks like a physical addresses, yes.

Quoted 7 lines
Quoted 2 lines

parisc: Show initial kernel memory layout unhashed
parisc: Show unhashed HPA of Dino chip

But these are virtual addresses and should be just removed, not switched to %px. They're not physical addresses that I can see, e.g. "dino_dev" is clearly being used as an in-memory structure, and the kernel layout literally says "virtual kernel memory layout".

Agreed, some of those should go.
I'll clean that up in upcoming patches.

Thanks!
Helge

author maintainer
#3 lore raw
In reply to Kees Cook

Subject: [PATCH] parisc: Hide virtual kernel memory layout

For security reasons do not expose the virtual kernel memory layout to userspace.

arch/parisc/mm/init.c +6 -1
index 48f41399fc0b..cab32ee824d2 100644
@@ -629,7 +629,12 @@ void __init mem_init(void)
 #endif
 
 	mem_init_print_info(NULL);
-#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
+
+#if 0
+	/*
+	 * Do not expose the virtual kernel memory layout to userspace.
+	 * But keep code for debugging purposes.
+	 */
 	printk("virtual kernel memory layout:\n"
 	       "    vmalloc : 0x%px - 0x%px   (%4ld MB)\n"
 	       "    memory  : 0x%px - 0x%px   (%4ld MB)\n"
Reviewed-by
#4 lore raw
Quoted 10 lines · Helge Deller

Subject: [PATCH] parisc: Hide virtual kernel memory layout

For security reasons do not expose the virtual kernel memory layout to userspace.

Thanks!

-Kees

Quoted 19 lines
arch/parisc/mm/init.c +6 -1
index 48f41399fc0b..cab32ee824d2 100644
@@ -629,7 +629,12 @@ void __init mem_init(void)
 #endif
 
        mem_init_print_info(NULL);
-#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
+
+#if 0
+       /*
+        * Do not expose the virtual kernel memory layout to userspace.
+        * But keep code for debugging purposes.
+        */
        printk("virtual kernel memory layout:\n"
               "    vmalloc : 0x%px - 0x%px   (%4ld MB)\n"
               "    memory  : 0x%px - 0x%px   (%4ld MB)\n"
Signature · 2 lines
Kees Cook
Pixel Security