File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,24 @@ static __always_inline void * __must_check kasan_krealloc(const void *object,
213
213
}
214
214
215
215
void __kasan_mempool_poison_object (void * ptr , unsigned long ip );
216
+ /**
217
+ * kasan_mempool_poison_object - Check and poison a mempool slab allocation.
218
+ * @ptr: Pointer to the slab allocation.
219
+ *
220
+ * This function is intended for kernel subsystems that cache slab allocations
221
+ * to reuse them instead of freeing them back to the slab allocator (e.g.
222
+ * mempool).
223
+ *
224
+ * This function poisons a slab allocation without initializing its memory and
225
+ * without putting it into the quarantine (for the Generic mode).
226
+ *
227
+ * This function also performs checks to detect double-free and invalid-free
228
+ * bugs and reports them.
229
+ *
230
+ * This function operates on all slab allocations including large kmalloc
231
+ * allocations (the ones returned by kmalloc_large() or by kmalloc() with the
232
+ * size > KMALLOC_MAX_SIZE).
233
+ */
216
234
static __always_inline void kasan_mempool_poison_object (void * ptr )
217
235
{
218
236
if (kasan_enabled ())
You can’t perform that action at this time.
0 commit comments