Patch "kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined" has been added to the 5.15-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

    kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined

to the 5.15-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:
     kselftest-vdso-fix-accumulation-of-uninitialized-ret.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 12e00d95875ce0305649757bf5a24106274d0f0d
Author: Colin Ian King <colin.i.king@xxxxxxxxx>
Date:   Mon Apr 17 11:47:43 2023 +0100

    kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined
    
    [ Upstream commit 375b9ff53cb6f9c042817b75f2be0a650626dc4f ]
    
    In the unlikely case that CLOCK_REALTIME is not defined, variable ret is
    not initialized and further accumulation of return values to ret can leave
    ret in an undefined state. Fix this by initialized ret to zero and changing
    the assignment of ret to an accumulation for the CLOCK_REALTIME case.
    
    Fixes: 03f55c7952c9 ("kselftest: Extend vDSO selftest to clock_getres")
    Signed-off-by: Colin Ian King <colin.i.king@xxxxxxxxx>
    Reviewed-by: Vincenzo Frascino <vincenzo.frascino@xxxxxxx>
    Signed-off-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/vDSO/vdso_test_clock_getres.c b/tools/testing/selftests/vDSO/vdso_test_clock_getres.c
index 15dcee16ff726..38d46a8bf7cba 100644
--- a/tools/testing/selftests/vDSO/vdso_test_clock_getres.c
+++ b/tools/testing/selftests/vDSO/vdso_test_clock_getres.c
@@ -84,12 +84,12 @@ static inline int vdso_test_clock(unsigned int clock_id)
 
 int main(int argc, char **argv)
 {
-	int ret;
+	int ret = 0;
 
 #if _POSIX_TIMERS > 0
 
 #ifdef CLOCK_REALTIME
-	ret = vdso_test_clock(CLOCK_REALTIME);
+	ret += vdso_test_clock(CLOCK_REALTIME);
 #endif
 
 #ifdef CLOCK_BOOTTIME



[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