On 08/06/26 21:09, Bjorn Helgaas wrote:

On Wed, May 27, 2026 at 11:38:14PM +0530, Aditya Gupta wrote:
For opencapi phb direct slots, the .pdev for php_slots will be NULL

Various sections of the code in pnv_php can do a null dereference and
crash the kernel.

Originally, the issue was hit during boot:

     [    1.568588] PowerPC PowerNV PCI Hotplug Driver version: 0.1
     [    1.569722] BUG: Kernel NULL pointer dereference at 0x00000074
     [    1.569811] Faulting instruction address: 0xc000000000b75fd0
     [    1.569890] Oops: Kernel access of bad area, sig: 11 [#1]
     [    1.569963] LE PAGE_SIZE=64K MMU=Hash  SMP NR_CPUS=2048 NUMA PowerNV
     ...
     [    1.571492] NIP [c000000000b75fd0] pnv_php_get_adapter_state+0x60/0x154
     [    1.571604] LR [c000000000b75fbc] pnv_php_get_adapter_state+0x4c/0x154
     [    1.571690] Call Trace:
     [    1.571725] [c000c0000688f990] [c000000000b75fbc] 
pnv_php_get_adapter_state+0x4c/0x154 (unreliable)
     [    1.571783] [c000c0000688fa20] [c000000000b78bd0] 
pnv_php_enable+0x94/0x378
     [    1.571951] [c000c0000688fac0] [c000000000b7912c] 
pnv_php_register_one.isra.0+0x11c/0x1e0
Drop timestamps since they don't add useful information.

Indent quoted material by two spaces to reduce wrapping.

Run "git log --oneline drivers/pci/hotplug/pnv_php.c" and "git log
--oneline drivers/pci/hotplug/" and match subject line style.

This occurs for hotplug slots on root buses where bus->self == NULL,
such as OpenCAPI PHB direct slots. An added debug print (not part of
this patch) confirmed it was opencapi:
Style "OpenCAPI" and "PHB" consistently in commit log and subject.

Thanks for the review Bjorn, fixed the description and have sent the patch again as v3.

In v3, I have sent the patch #1 independently for rc, and will send the rework patches (patches #2 and #3) separately, since I have to do extra fixes for pre-existing issues pointed by sashiko.

Thanks,
- Aditya G



Reply via email to