diff options
author | Ammar Faizi <ammarfaizi2@gnuweeb.org> | 2022-12-23 18:23:38 +0100 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2023-02-10 21:33:37 +0100 |
commit | 5541992e512de8c9133110809f767bd1b54ee10d (patch) | |
tree | d9b457237b4bf9ead98a7f9ade2c9a80d60161bf /arch/x86 | |
parent | rust: arch/um: Add support for CONFIG_RUST under x86_64 UML (diff) | |
download | linux-5541992e512de8c9133110809f767bd1b54ee10d.tar.xz linux-5541992e512de8c9133110809f767bd1b54ee10d.zip |
x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list
The 'syscall' instruction clobbers '%rcx' and '%r11', but they are not
listed in the inline Assembly that performs the syscall instruction.
No real bug is found. It wasn't buggy by luck because '%rcx' and '%r11'
are caller-saved registers, and not used in the functions, and the
functions are never inlined.
Add them to the clobber list for code correctness.
Fixes: f1c2bb8b9964ed31de988910f8b1cfb586d30091 ("um: implement a x86_64 vDSO")
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/um/vdso/um_vdso.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/um/vdso/um_vdso.c b/arch/x86/um/vdso/um_vdso.c index 2112b8d14668..ff0f3b4b6c45 100644 --- a/arch/x86/um/vdso/um_vdso.c +++ b/arch/x86/um/vdso/um_vdso.c @@ -17,8 +17,10 @@ int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts) { long ret; - asm("syscall" : "=a" (ret) : - "0" (__NR_clock_gettime), "D" (clock), "S" (ts) : "memory"); + asm("syscall" + : "=a" (ret) + : "0" (__NR_clock_gettime), "D" (clock), "S" (ts) + : "rcx", "r11", "memory"); return ret; } @@ -29,8 +31,10 @@ int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) { long ret; - asm("syscall" : "=a" (ret) : - "0" (__NR_gettimeofday), "D" (tv), "S" (tz) : "memory"); + asm("syscall" + : "=a" (ret) + : "0" (__NR_gettimeofday), "D" (tv), "S" (tz) + : "rcx", "r11", "memory"); return ret; } |