From 79eb92cd9aaa439249f2900dbd7d3672ae193afd Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Thu, 18 Apr 2019 14:41:40 -0400 Subject: [PATCH] Implement secure alloc/free using vmalloc/vfree In kernel there is no point in mlocking and zeroring memory before freeing. Signed-off-by: Adam Rutkowski --- modules/cas_cache/ocf_env.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/cas_cache/ocf_env.h b/modules/cas_cache/ocf_env.h index 7c9621d..feb8450 100644 --- a/modules/cas_cache/ocf_env.h +++ b/modules/cas_cache/ocf_env.h @@ -55,6 +55,16 @@ static inline void env_vfree(const void *ptr) cas_vfree(ptr); } +static inline void *env_secure_alloc(size_t size) +{ + return env_vmalloc(size); +} + +static inline void env_secure_free(const void *ptr, size_t size) +{ + env_vfree(ptr); +} + /* *** ALLOCATOR *** */ typedef struct _env_allocator env_allocator;