Files
linux-stable-mirror/include/linux
David Laight af4e9ef3d7 uaccess: Fix scoped_user_read_access() for 'pointer to const'
If a 'const struct foo __user *ptr' is used for the address passed to
scoped_user_read_access() then you get a warning/error

  uaccess.h:691:1: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]

for the

  void __user *_tmpptr = __scoped_user_access_begin(mode, uptr, size, elbl)

assignment.

Fix by using 'auto' for both _tmpptr and the redeclaration of uptr.
Replace the CLASS() with explicit __cleanup() functions on uptr.

Fixes: e497310b4f ("uaccess: Provide scoped user access regions")
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Reviewed-and-tested-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-03-02 09:24:32 -08:00
..
2026-02-11 13:44:47 +01:00
2025-10-22 07:54:33 +02:00
2024-10-13 17:16:57 +02:00
2026-01-29 20:21:41 +01:00
2025-12-15 14:33:38 +01:00
2024-10-14 23:27:57 +05:30
2022-07-05 20:25:39 +02:00
2025-02-21 09:54:01 +01:00
2025-07-21 18:18:51 +01:00
2026-01-20 19:44:19 -08:00
2025-04-21 10:27:59 +02:00
2025-04-29 15:58:38 -04:00
2025-07-31 11:28:03 -04:00
2026-02-12 04:23:53 -07:00
2024-10-14 18:33:04 -07:00
2025-11-21 11:21:31 +01:00
2025-03-08 14:37:39 +01:00
2018-06-15 18:10:01 -03:00
2024-06-24 18:29:20 +02:00
2025-05-21 13:39:45 +02:00
2025-04-11 18:58:10 -07:00
2025-09-23 11:13:22 +02:00
2024-02-20 14:22:55 -05:00
2024-11-05 13:32:21 +01:00
2019-12-03 11:20:37 +01:00
2023-01-29 15:18:33 -07:00
2023-01-29 15:18:33 -07:00
2025-12-16 14:40:51 +01:00
2025-10-22 07:55:00 +02:00
2025-11-01 12:44:49 -05:00
2021-08-26 15:32:28 -04:00
2018-01-01 12:40:27 -07:00
2025-12-13 20:04:32 +12:00
2024-05-19 14:36:17 -07:00
2025-08-21 13:58:07 +02:00
2026-02-19 09:12:05 +01:00
2025-12-23 11:23:10 -08:00
2022-01-20 08:52:54 +02:00
2021-07-27 20:11:45 +01:00
2021-07-27 20:11:44 +01:00
2010-02-09 11:13:56 +01:00
2025-10-29 18:28:29 -07:00
2025-09-13 17:32:44 -07:00
2025-08-29 13:39:53 -07:00
2026-01-12 16:52:09 +01:00
2025-11-04 12:36:02 +01:00
2024-11-24 17:05:27 -08:00
2026-02-06 07:29:14 -07:00
2025-10-22 07:53:15 +02:00
2023-12-20 19:26:31 -05:00
2024-10-16 21:56:59 +02:00
2024-09-03 21:15:46 -07:00
2019-12-11 09:12:38 +01:00
2025-06-11 11:57:14 -07:00
2024-02-17 16:20:41 +01:00
2026-01-05 16:43:31 +01:00
2025-03-08 12:13:25 +01:00
2026-01-11 06:09:11 -10:00
2024-10-14 16:33:24 -05:00
2026-01-20 19:24:50 -08:00
2026-01-26 19:03:47 -08:00
2025-11-23 12:30:40 +01:00
2025-12-29 11:53:38 +01:00
2026-01-26 20:02:27 -08:00
2025-09-17 15:58:29 -04:00
2022-08-02 12:34:04 -04:00
2025-06-17 18:18:46 -07:00
2018-10-17 13:56:58 -07:00
2025-11-04 19:10:33 -08:00
2025-09-23 13:28:20 -04:00
2025-11-05 23:58:20 +01:00
2025-11-03 17:41:17 +01:00
2025-11-11 10:01:30 +01:00
2026-02-20 17:31:55 -05:00
2025-02-18 11:51:22 -05:00
2018-01-08 08:22:45 -06:00
2021-02-03 19:05:50 +01:00
2024-08-30 08:22:38 +02:00
2024-11-16 10:09:30 -06:00
2025-05-21 16:46:37 +02:00
2026-02-10 11:39:31 +01:00
2026-02-10 11:39:30 +01:00
2026-01-11 06:09:11 -10:00
2025-03-12 20:41:14 +01:00
2025-08-24 11:41:11 -06:00
2025-01-10 11:59:00 +01:00
2025-07-01 12:29:29 +02:00
2025-10-30 18:35:26 +01:00
2025-10-24 21:39:27 +02:00
2023-08-12 09:18:47 -07:00
2019-06-15 12:25:49 +02:00
2025-11-27 14:24:30 -08:00
2025-11-18 17:52:54 +01:00
2022-03-08 14:33:36 -06:00
2024-12-09 14:44:59 -08:00
2025-05-06 11:11:45 -06:00
2026-01-11 06:09:11 -10:00
2025-03-17 11:52:25 +01:00
2025-11-28 09:21:18 -07:00
2026-02-23 11:19:18 +01:00
2023-01-19 15:01:19 +01:00
2024-04-09 10:53:44 +02:00
2020-12-10 16:17:15 +01:00
2026-01-05 16:43:30 +01:00
2021-08-19 09:02:55 +09:00
2024-05-04 18:57:21 +02:00
2023-10-18 14:43:21 -07:00
2026-01-31 14:22:57 -08:00
2023-08-21 13:37:26 -07:00
2022-09-29 15:20:29 +02:00
2026-01-14 12:04:34 +01:00
2020-10-30 21:57:04 +01:00
2024-10-02 16:53:38 +02:00
2025-08-17 12:46:25 +02:00
2025-03-20 08:00:50 -07:00
2026-01-06 17:06:03 -08:00
2025-02-12 12:12:27 +01:00
2026-01-11 06:09:11 -10:00
2025-11-03 17:41:18 +01:00
2023-03-23 17:25:46 +01:00
2024-06-24 18:16:44 +01:00
2026-01-20 19:24:47 -08:00
2026-01-30 18:26:59 -08:00
2025-03-13 13:25:58 -07:00
2025-03-13 13:25:58 -07:00
2025-03-13 13:25:58 -07:00