s390/process: avoid potential reading of freed stack
authorVasily Gorbik <gor@linux.ibm.com>
Tue, 13 Aug 2019 18:11:08 +0000 (20:11 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 21 Aug 2019 10:58:52 +0000 (12:58 +0200)
commit8769f610fe6d473e5e8e221709c3ac402037da6c
treec740258be7d3cd1f37d7c58d4495d7b11af31ce9
parentf45f7b5bdaa4828ce871cf03f7c01599a0de57a5
s390/process: avoid potential reading of freed stack

With THREAD_INFO_IN_TASK (which is selected on s390) task's stack usage
is refcounted and should always be protected by get/put when touching
other task's stack to avoid race conditions with task's destruction code.

Fixes: d5c352cdd022 ("s390: move thread_info into task_struct")
Cc: stable@vger.kernel.org # v4.10+
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/process.c