Re: [PATCH 2/2] devres: Provide kmalloc_obj*-style API for devm_kmalloc

From: Greg Kroah-Hartman

Date: Mon Oct 05 2026 - 17:35:28 EST


On Mon, Sep 14, 2026 at 03:32:17PM -0700, Kees Cook wrote:
> Mirroring the type-based allocation now in use for the kmalloc family of
> APIs, provide the same for the devm_kmalloc family of APIs. This will
> allow for future plumbing of type information (e.g. alignment) into the
> underlying allocations. This immediately gains type check on return
> values (instead of the prior "void *" return type).
>
> Signed-off-by: Kees Cook <kees@xxxxxxxxxx>
> ---
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
> Cc: Danilo Krummrich <dakr@xxxxxxxxxx>
> Cc: "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>
> Cc: <driver-core@xxxxxxxxxxxxxxx>
> Cc: <linux-hardening@xxxxxxxxxxxxxxx>
> ---
> include/linux/device/devres.h | 102 ++++++++++++++++++++++++++++++++++
> 1 file changed, 102 insertions(+)


I'm guessing you want this to go through your tree? If so, that's
great:

Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Otherwise let us know and we can take it through the driver core tree.

thanks,

greg k-h