Patch "x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-um-vdso-add-rcx-and-r11-to-the-syscall-clobber-l.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d9ab999a8a12a80c65e884a07f80b15a5a7ae9b6
Author: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
Date:   Sat Dec 24 00:23:38 2022 +0700

    x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list
    
    [ Upstream commit 5541992e512de8c9133110809f767bd1b54ee10d ]
    
    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@xxxxxxxxxxx>
    Signed-off-by: Richard Weinberger <richard@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/um/vdso/um_vdso.c b/arch/x86/um/vdso/um_vdso.c
index 7c441b59d3752..be99ff25c5039 100644
--- a/arch/x86/um/vdso/um_vdso.c
+++ b/arch/x86/um/vdso/um_vdso.c
@@ -20,8 +20,10 @@ int __vdso_clock_gettime(clockid_t clock, struct 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;
 }
@@ -32,8 +34,10 @@ int __vdso_gettimeofday(struct 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;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux