Re: [PATCH net v6 2/4] dpll: fix pin dump crash for rebound module

From: Jiri Pirko
Date: Fri Jan 19 2024 - 10:16:57 EST


Fri, Jan 19, 2024 at 02:43:02PM CET, arkadiusz.kubalewski@xxxxxxxxx wrote:
>When a kernel module is unbound but the pin resources were not entirely
>freed (other kernel module instance of the same PCI device have had kept
>the reference to that pin), and kernel module is again bound, the pin
>properties would not be updated (the properties are only assigned when
>memory for the pin is allocated), prop pointer still points to the
>kernel module memory of the kernel module which was deallocated on the
>unbind.
>
>If the pin dump is invoked in this state, the result is a kernel crash.
>Prevent the crash by storing persistent pin properties in dpll subsystem,
>copy the content from the kernel module when pin is allocated, instead of
>using memory of the kernel module.
>
>Fixes: 9431063ad323 ("dpll: core: Add DPLL framework base functions")
>Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base functions")
>Reviewed-by: Jan Glaza <jan.glaza@xxxxxxxxx>
>Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@xxxxxxxxx>
>Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@xxxxxxxxx>

Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>