From abcac97f8202d91b61ae4846794ba60166a56cfe Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Mon, 24 May 2021 18:43:33 +0000 Subject: [PATCH] LinuxKPI: add kfree_sensitive() using zfree(). Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D30437 --- sys/compat/linuxkpi/common/include/linux/slab.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index 9494d458e87c..8d5eb3e85e96 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -198,6 +198,12 @@ kfree(const void *ptr) free(__DECONST(void *, ptr), M_KMALLOC); } +static __inline void +kfree_sensitive(const void *ptr) +{ + zfree(__DECONST(void *, ptr), M_KMALLOC); +} + static inline size_t ksize(const void *ptr) {