Patch "selftests/net: ipsec: fix constant out of range" 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

    selftests/net: ipsec: fix constant out of range

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:
     selftests-net-ipsec-fix-constant-out-of-range.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 e13238682e8f8df3aafc2baacebf40d22c2da886
Author: Willem de Bruijn <willemb@xxxxxxxxxx>
Date:   Fri Nov 24 12:15:19 2023 -0500

    selftests/net: ipsec: fix constant out of range
    
    [ Upstream commit 088559815477c6f623a5db5993491ddd7facbec7 ]
    
    Fix a small compiler warning.
    
    nr_process must be a signed long: it is assigned a signed long by
    strtol() and is compared against LONG_MIN and LONG_MAX.
    
    ipsec.c:2280:65:
        error: result of comparison of constant -9223372036854775808
        with expression of type 'unsigned int' is always false
        [-Werror,-Wtautological-constant-out-of-range-compare]
    
      if ((errno == ERANGE && (nr_process == LONG_MAX || nr_process == LONG_MIN))
    
    Fixes: bc2652b7ae1e ("selftest/net/xfrm: Add test for ipsec tunnel")
    Signed-off-by: Willem de Bruijn <willemb@xxxxxxxxxx>
    Reviewed-by: Dmitry Safonov <0x7f454c46@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20231124171645.1011043-2-willemdebruijn.kernel@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/net/ipsec.c b/tools/testing/selftests/net/ipsec.c
index 3d7dde2c321b3..c5be3f390849b 100644
--- a/tools/testing/selftests/net/ipsec.c
+++ b/tools/testing/selftests/net/ipsec.c
@@ -2278,7 +2278,7 @@ static int check_results(void)
 
 int main(int argc, char **argv)
 {
-	unsigned int nr_process = 1;
+	long nr_process = 1;
 	int route_sock = -1, ret = KSFT_SKIP;
 	int test_desc_fd[2];
 	uint32_t route_seq;
@@ -2299,7 +2299,7 @@ int main(int argc, char **argv)
 			exit_usage(argv);
 		}
 
-		if (nr_process > MAX_PROCESSES || !nr_process) {
+		if (nr_process > MAX_PROCESSES || nr_process < 1) {
 			printk("nr_process should be between [1; %u]",
 					MAX_PROCESSES);
 			exit_usage(argv);



[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