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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2019 16:20:41 +0000 (18:20 +0200)
commit8b41a30f91dbc4dfade46e4cc161cb49561f606f
treef02058edd09f20eae7bcc1ca0d2b845f72adae0b
parent58fce20645303bee01d74144ec00e405be43b1ca
s390/process: avoid potential reading of freed stack

commit 8769f610fe6d473e5e8e221709c3ac402037da6c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kernel/process.c