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
..
2023-12-08 08:52:20 +01:00
2009-12-12 13:08:14 +01:00
2019-05-30 11:26:32 -07:00
2024-04-03 15:28:21 +02:00
2023-06-05 09:57:16 +02:00
2020-10-15 08:10:38 +02:00
2022-08-22 11:09:17 +02:00
2023-12-13 18:45:30 +01:00
2024-08-14 13:58:57 +02:00
2024-06-21 14:38:37 +02:00
2024-04-03 15:28:22 +02:00
2023-04-29 09:08:44 +02:00
2017-11-02 11:10:55 +01:00
2022-04-26 13:35:54 -07:00
2022-03-11 19:49:31 +01:00
2017-11-02 11:10:55 +01:00
2023-02-15 12:35:20 +01:00
2023-08-10 19:12:16 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2023-11-28 17:20:08 +00:00
2024-02-23 09:25:18 +01:00
2023-04-20 10:05:01 +02:00
2022-05-23 13:44:24 +02:00
2022-06-28 13:20:21 +02:00
2023-08-10 22:51:54 +02:00
2022-02-25 09:36:06 +01:00
2023-05-03 17:43:26 +02:00
2021-02-10 23:34:16 +01:00
2022-10-31 15:37:14 +01:00
2017-11-02 11:10:55 +01:00
2025-03-13 12:58:38 +01:00
2023-08-18 10:12:35 -07:00
2021-01-26 19:57:26 +01:00
2023-06-30 17:14:13 +02:00
2024-02-23 09:24:47 +01:00
2017-11-02 11:10:55 +01:00
2023-02-13 22:13:29 +01:00
2019-12-15 21:05:38 +01:00
2021-10-30 23:11:00 +02:00
2023-05-03 17:41:21 +02:00
2022-03-18 09:10:14 +01:00
2023-12-08 08:52:19 +01:00
2023-08-28 17:58:14 +02:00
2018-08-21 14:32:44 +02:00
2024-11-22 15:38:37 +01:00
2022-03-11 19:49:31 +01:00
2022-03-11 19:49:30 +01:00
2019-05-03 23:47:40 +02:00
2017-11-02 11:10:55 +01:00
2024-06-16 13:47:45 +02:00
2021-08-30 10:18:25 +02:00
2017-11-02 11:10:55 +01:00
2019-06-08 12:56:25 +02:00
2022-07-22 17:23:45 -05:00
2021-05-07 00:26:34 -07:00
2023-09-07 09:12:20 +02:00
2022-03-29 21:37:12 +02:00
2010-10-18 19:58:50 +02:00
2017-11-02 11:10:55 +01:00
2022-07-17 17:14:43 -07:00
2025-08-28 16:28:37 +02:00
2017-11-02 11:10:55 +01:00
2023-11-28 17:20:08 +00:00
2019-06-25 14:52:26 +02:00
2021-11-01 07:36:00 +01:00
2023-08-31 21:42:42 +02:00
2022-03-11 19:49:30 +01:00
2023-08-28 18:00:27 +02:00
2020-11-20 11:16:34 -08:00
2022-02-16 23:25:11 +11:00
2013-11-30 21:02:18 +01:00
2023-09-07 08:00:32 +02:00
2024-06-16 13:47:45 +02:00
2022-03-29 21:37:12 +02:00
2020-10-15 08:10:38 +02:00
2019-05-03 23:47:40 +02:00
2025-08-28 16:28:37 +02:00
2023-10-07 20:30:16 +02:00
2023-08-10 17:32:09 +02:00
2021-08-29 10:13:32 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-07-16 19:23:24 -07:00
2021-11-04 11:21:47 +01:00
2022-05-13 23:59:23 +02:00
2019-12-04 19:44:15 -08:00
2022-03-11 19:49:30 +01:00
2022-03-29 21:37:12 +02:00
2022-03-11 19:49:30 +01:00
2025-08-28 16:28:37 +02:00
2017-11-02 11:10:55 +01:00
2021-11-01 07:36:00 +01:00
2022-05-31 14:10:54 -07:00
2018-08-17 17:00:08 +02:00
2022-03-11 19:49:30 +01:00
2019-12-10 10:12:55 +01:00