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-10-10 09:27:46 -07:00
2022-04-11 18:04:27 +02:00
2022-10-11 20:07:44 -07:00
2022-04-14 14:09:43 +02:00
2022-10-04 13:38:03 -07:00
2022-10-09 08:56:54 -07:00
2022-10-12 14:39:38 -07:00
2022-07-25 10:32:32 +02:00
2021-12-11 09:09:45 +01:00
2022-10-10 12:00:45 -07:00