Skip to content

Commit 8d5341a

Browse files
aryabinintorvalds
authored andcommitted
x86/ldt: use vfree_atomic() to free ldt entries
vfree() is going to use sleeping lock. free_ldt_struct() may be called with disabled preemption, therefore we must use vfree_atomic() here. E.g. call trace: vfree() free_ldt_struct() destroy_context_ldt() __mmdrop() finish_task_switch() schedule_tail() ret_from_fork() Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Andrey Ryabinin <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Cc: Joel Fernandes <[email protected]> Cc: Jisheng Zhang <[email protected]> Cc: Chris Wilson <[email protected]> Cc: John Dias <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0f110a9 commit 8d5341a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/ldt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static void free_ldt_struct(struct ldt_struct *ldt)
9393

9494
paravirt_free_ldt(ldt->entries, ldt->size);
9595
if (ldt->size * LDT_ENTRY_SIZE > PAGE_SIZE)
96-
vfree(ldt->entries);
96+
vfree_atomic(ldt->entries);
9797
else
9898
free_page((unsigned long)ldt->entries);
9999
kfree(ldt);

0 commit comments

Comments
 (0)