Alexander Potapenko 59c8a02e24 x86: asm: make sure __put_user_size() evaluates pointer once
User access macros must ensure their arguments are evaluated only once if
they are used more than once in the macro body.  Adding
instrument_put_user() to __put_user_size() resulted in double evaluation
of the `ptr` argument, which led to correctness issues when performing
e.g.  unsafe_put_user(..., p++, ...).

To fix those issues, evaluate the `ptr` argument of __put_user_size() at
the beginning of the macro.

Link: https://lkml.kernel.org/r/20221024212144.2852069-4-glider@google.com
Fixes: 888f84a6da4d ("x86: asm: instrument usercopy in get_user() and put_user()")
Signed-off-by: Alexander Potapenko <glider@google.com>
Reported-by: youling257 <youling257@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-10-28 13:37:23 -07:00
..
2022-05-23 17:51:12 -07:00
2021-10-20 22:35:04 +02:00
2021-03-18 15:31:53 +01:00
2022-08-04 11:11:59 +02:00
2022-06-27 10:33:58 +02:00
2020-01-23 10:41:20 -08:00
2022-09-26 10:13:16 -07:00
2021-03-18 15:31:53 +01:00
2022-08-31 14:34:11 -07:00
2022-09-29 12:20:50 +02:00
2020-05-07 16:06:20 +02:00
2022-08-03 14:38:02 -07:00
2022-04-12 15:42:59 +02:00
2021-12-11 09:09:47 +01:00
2021-10-28 23:25:26 +02:00
2020-10-28 20:26:25 +01:00
2021-10-05 21:48:30 +02:00
2022-08-19 04:05:42 -04:00
2020-11-26 12:58:56 +01:00
2022-06-28 13:20:21 +02:00
2020-11-06 23:14:58 +01:00
2021-02-24 16:32:23 -08:00
2022-10-03 14:03:26 -07:00
2022-04-07 08:27:52 -07:00
2022-04-14 14:09:43 +02:00
2020-09-16 16:52:28 +02:00
2022-10-10 09:27:46 -07:00
2020-10-14 11:42:04 -07:00
2021-12-11 09:09:45 +01:00
2021-07-01 11:06:03 -07:00
2022-08-21 10:06:28 -07:00
2022-04-14 14:15:54 +02:00
2022-08-25 15:54:03 +02:00
2022-07-07 10:13:02 -07:00
2021-12-11 09:09:45 +01:00
2019-04-10 09:53:31 +02:00
2020-03-21 16:03:25 +01:00
2022-04-07 08:27:52 -07:00
2020-11-17 14:36:13 +01:00
2022-08-18 12:36:42 +02:00
2022-01-30 21:17:00 -05:00
2022-01-30 21:17:00 -05:00
2020-03-23 18:45:14 +01:00
2022-06-08 05:56:24 -04:00
2020-01-14 12:20:58 +01:00