Re: [PATCH] kunit: Device wrappers should also manage driver name

From: Maxime Ripard
Date: Wed Jul 31 2024 - 04:35:08 EST


On Wed, 31 Jul 2024 15:02:06 +0800, David Gow wrote:
> kunit_driver_create() accepts a name for the driver, but does not copy
> it, so if that name is either on the stack, or otherwise freed, we end
> up with a use-after-free when the driver is cleaned up.
>
> Instead, strdup() the name, and manage it as another KUnit allocation.
>
> [ ... ]

Reviewed-by: Maxime Ripard <mripard@xxxxxxxxxx>

Thanks!
Maxime