diff options
author | Andrey Ryabinin <aryabinin@virtuozzo.com> | 2016-08-02 17:02:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-02 17:31:41 -0400 |
commit | f7376aed6c032aab820fa36806a89e16e353a0d9 (patch) | |
tree | 1733d516f1e420338389bea26c66ef32f72b3409 | |
parent | 4b3ec5a3f4b1d5c9d64b9ab704042400d050d432 (diff) |
mm/kasan, slub: don't disable interrupts when object leaves quarantine
SLUB doesn't require disabled interrupts to call ___cache_free().
Link: http://lkml.kernel.org/r/1470062715-14077-3-git-send-email-aryabinin@virtuozzo.com
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/kasan/quarantine.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c index 65793f150d1f..4852625ff851 100644 --- a/mm/kasan/quarantine.c +++ b/mm/kasan/quarantine.c | |||
@@ -147,10 +147,14 @@ static void qlink_free(struct qlist_node *qlink, struct kmem_cache *cache) | |||
147 | struct kasan_alloc_meta *alloc_info = get_alloc_info(cache, object); | 147 | struct kasan_alloc_meta *alloc_info = get_alloc_info(cache, object); |
148 | unsigned long flags; | 148 | unsigned long flags; |
149 | 149 | ||
150 | local_irq_save(flags); | 150 | if (IS_ENABLED(CONFIG_SLAB)) |
151 | local_irq_save(flags); | ||
152 | |||
151 | alloc_info->state = KASAN_STATE_FREE; | 153 | alloc_info->state = KASAN_STATE_FREE; |
152 | ___cache_free(cache, object, _THIS_IP_); | 154 | ___cache_free(cache, object, _THIS_IP_); |
153 | local_irq_restore(flags); | 155 | |
156 | if (IS_ENABLED(CONFIG_SLAB)) | ||
157 | local_irq_restore(flags); | ||
154 | } | 158 | } |
155 | 159 | ||
156 | static void qlist_free_all(struct qlist_head *q, struct kmem_cache *cache) | 160 | static void qlist_free_all(struct qlist_head *q, struct kmem_cache *cache) |