diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2017-01-23 22:40:10 -0500 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2018-05-16 13:23:44 +0200 |
| commit | 0b71db97a50218f16fd49d39907710cf24fed0d7 (patch) | |
| tree | 43cfbbc189afd7e8478fea7f8eebea12178fb8dd | |
| parent | c9eb9030eb59dc92cdf36e732d177fb9f50d5fdd (diff) | |
add slub sanitization
| -rw-r--r-- | mm/slub.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2830,6 +2830,13 @@ static __always_inline void slab_free(struct kmem_cache *s, slab_free_hook(s, x); + if (!(s->flags & (SLAB_DESTROY_BY_RCU | SLAB_POISON))) { + size_t offset = s->offset ? 0 : sizeof(void *); + memset(x + offset, 0, s->object_size - offset); + if (s->ctor) + s->ctor(x); + } + redo: /* * Determine the currently cpus per cpu slab. |
