Patch "powerpc/64: Set _IO_BASE to POISON_POINTER_DELTA not 0 for CONFIG_PCI=n" has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    powerpc/64: Set _IO_BASE to POISON_POINTER_DELTA not 0 for CONFIG_PCI=n

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powerpc-64-set-_io_base-to-poison_pointer_delta-not-.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 68a2ae4788076eddd4bca95129e51c532620dc55
Author: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Date:   Fri May 3 17:56:19 2024 +1000

    powerpc/64: Set _IO_BASE to POISON_POINTER_DELTA not 0 for CONFIG_PCI=n
    
    [ Upstream commit be140f1732b523947425aaafbe2e37b41b622d96 ]
    
    There is code that builds with calls to IO accessors even when
    CONFIG_PCI=n, but the actual calls are guarded by runtime checks.
    
    If not those calls would be faulting, because the page at virtual
    address zero is (usually) not mapped into the kernel. As Arnd pointed
    out, it is possible a large port value could cause the address to be
    above mmap_min_addr which would then access userspace, which would be
    a bug.
    
    To avoid any such issues, set _IO_BASE to POISON_POINTER_DELTA. That
    is a value chosen to point into unmapped space between the kernel and
    userspace, so any access will always fault.
    
    Note that on 32-bit POISON_POINTER_DELTA is 0, so the patch only has an
    effect on 64-bit.
    
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://msgid.link/20240503075619.394467-2-mpe@xxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index ba2e13bb879dc..048e3705af20b 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -37,7 +37,7 @@ extern struct pci_dev *isa_bridge_pcidev;
  * define properly based on the platform
  */
 #ifndef CONFIG_PCI
-#define _IO_BASE	0
+#define _IO_BASE	POISON_POINTER_DELTA
 #define _ISA_MEM_BASE	0
 #define PCI_DRAM_OFFSET 0
 #elif defined(CONFIG_PPC32)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux