mm: Change vm_is_stack_for_task() to vm_is_stack_for_current()

Asking for a non-current task's stack can't be done without races
unless the task is frozen in kernel mode.  As far as I know,
vm_is_stack_for_task() never had a safe non-current use case.

The __unused annotation is because some KSTK_ESP implementations
ignore their parameter, which IMO is further justification for this

Signed-off-by: Andy Lutomirski <>
Acked-by: Thomas Gleixner <>
Cc: Al Viro <>
Cc: Andrew Morton <>
Cc: Borislav Petkov <>
Cc: Brian Gerst <>
Cc: Jann Horn <>
Cc: Kees Cook <>
Cc: Linus Torvalds <>
Cc: Linux API <>
Cc: Peter Zijlstra <>
Cc: Tycho Andersen <>
Signed-off-by: Ingo Molnar <>
3 files changed