Files
linux/arch/parisc/include/asm
John David Anglin 4c98107725 parisc: Revise __get_user() to probe user read access
commit 89f686a0fb6e473a876a9a60a13aec67a62b9a7e upstream.

Because of the way read access support is implemented, read access
interruptions are only triggered at privilege levels 2 and 3. The
kernel executes at privilege level 0, so __get_user() never triggers
a read access interruption (code 26). Thus, it is currently possible
for user code to access a read protected address via a system call.

Fix this by probing read access rights at privilege level 3 (PRIV_USER)
and setting __gu_err to -EFAULT (-14) if access isn't allowed.

Note the cmpiclr instruction does a 32-bit compare because COND macro
doesn't work inside asm.

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>
2025-08-28 16:28:37 +02:00
..
2024-08-14 13:58:57 +02:00
2022-06-28 13:20:21 +02:00
2022-02-25 09:36:06 +01:00
2023-08-18 10:12:35 -07:00
2023-02-13 22:13:29 +01:00
2021-10-30 23:11:00 +02:00
2022-03-11 19:49:30 +01:00
2025-08-28 16:28:37 +02:00
2019-06-25 14:52:26 +02:00
2023-08-31 21:42:42 +02:00
2022-03-11 19:49:30 +01:00
2019-07-16 19:23:24 -07:00
2022-03-11 19:49:30 +01:00
2022-03-11 19:49:30 +01:00