]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-linux-kernel/ti-linux-kernel.git/commit
parisc: Ensure consistent state when switching to kernel stack at syscall entry
authorJohn David Anglin <dave.anglin@bell.net>
Sat, 29 Oct 2016 03:00:34 +0000 (23:00 -0400)
committerSasha Levin <alexander.levin@verizon.com>
Sat, 26 Nov 2016 03:57:03 +0000 (22:57 -0500)
commit9fe6256c0020a220fdbd096886a40de1a5a73388
tree1d0e1e62554f5dd138d26870564f3d40708dcb7e
parent83a474ed7003b7065d3816d84dd0168f02a0ee94
parisc: Ensure consistent state when switching to kernel stack at syscall entry

[ Upstream commit 6ed518328d0189e0fdf1bb7c73290d546143ea66 ]

We have one critical section in the syscall entry path in which we switch from
the userspace stack to kernel stack. In the event of an external interrupt, the
interrupt code distinguishes between those two states by analyzing the value of
sr7. If sr7 is zero, it uses the kernel stack. Therefore it's important, that
the value of sr7 is in sync with the currently enabled stack.

This patch now disables interrupts while executing the critical section.  This
prevents the interrupt handler to possibly see an inconsistent state which in
the worst case can lead to crashes.

Interestingly, in the syscall exit path interrupts were already disabled in the
critical section which switches back to the userspace stack.

Cc: <stable@vger.kernel.org>
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
arch/parisc/kernel/syscall.S