[PATCH] powerpc/pseries: Fix use after free in remove_phb_dynamic()

Michael Ellerman mpe at ellerman.id.au
Mon Mar 21 13:18:17 AEDT 2022


Sachin Sant <sachinp at linux.ibm.com> writes:
>> On 18-Mar-2022, at 9:12 AM, Michael Ellerman <mpe at ellerman.id.au> wrote:
>> To avoid it, we can take a reference to the host_bridge->dev until we're
>> done using phb. Then when we drop the reference the phb will be freed.
>> 
>> Fixes: 2dd9c11b9d4d ("powerpc/pseries: use pci_host_bridge.release_fn() to kfree(phb)")
>> Reported-by: David Dai <zdai at linux.ibm.com>
>> Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
>>> Verified successfully with 5.17.0-rc8-00061-g34e047aa16c0 + patch.
>
> Tested-by: Sachin Sant <sachinp at linux.ibm.com>

Thanks for testing.

cheers


More information about the Linuxppc-dev mailing list