Skip to content

Commit

Permalink
mm/kasan, slub: don't disable interrupts when object leaves quarantine
Browse files Browse the repository at this point in the history
SLUB doesn't require disabled interrupts to call ___cache_free().

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Andrey Ryabinin <[email protected]>
Acked-by: Alexander Potapenko <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
aryabinin authored and torvalds committed Aug 2, 2016
1 parent 4b3ec5a commit f7376ae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mm/kasan/quarantine.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,14 @@ static void qlink_free(struct qlist_node *qlink, struct kmem_cache *cache)
struct kasan_alloc_meta *alloc_info = get_alloc_info(cache, object);
unsigned long flags;

local_irq_save(flags);
if (IS_ENABLED(CONFIG_SLAB))
local_irq_save(flags);

alloc_info->state = KASAN_STATE_FREE;
___cache_free(cache, object, _THIS_IP_);
local_irq_restore(flags);

if (IS_ENABLED(CONFIG_SLAB))
local_irq_restore(flags);
}

static void qlist_free_all(struct qlist_head *q, struct kmem_cache *cache)
Expand Down

0 comments on commit f7376ae

Please sign in to comment.