]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
parisc: Revise gateway LWS calls to probe user read access
authorJohn David Anglin <dave.anglin@bell.net>
Fri, 25 Jul 2025 16:12:14 +0000 (12:12 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:37 +0000 (16:28 +0200)
commit8bccf47adbf658293528e86960e6d6f736b1c9f7
tree7b94a5f75c479ba2a3f2d9878ac8d469f71afb70
parent4c981077255acc2ed5b3df6e8dd0125c81b626a9
parisc: Revise gateway LWS calls to probe user read access

commit f6334f4ae9a4e962ba74b026e1d965dfdf8cbef8 upstream.

We use load and stbys,e instructions to trigger memory reference
interruptions without writing to memory. Because of the way read
access support is implemented, read access interruptions are only
triggered at privilege levels 2 and 3. The kernel and gateway
page execute at privilege level 0, so this code never triggers
a read access interruption. Thus, it is currently possible for
user code to execute a LWS compare and swap operation at an
address that is read protected at privilege level 3 (PRIV_USER).

Fix this by probing read access rights at privilege level 3 and
branching to lws_fault if access isn't allowed.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v5.12+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/parisc/kernel/syscall.S