Patch "ipvs: check that ip_vs_conn_tab_bits is between 8 and 20" has been added to the 4.19-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

    ipvs: check that ip_vs_conn_tab_bits is between 8 and 20

to the 4.19-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:
     ipvs-check-that-ip_vs_conn_tab_bits-is-between-8-and.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 0f2837cd17ed7ad50d13c399a219c3a274de35bb
Author: Andrea Claudi <aclaudi@xxxxxxxxxx>
Date:   Fri Sep 10 18:08:39 2021 +0200

    ipvs: check that ip_vs_conn_tab_bits is between 8 and 20
    
    [ Upstream commit 69e73dbfda14fbfe748d3812da1244cce2928dcb ]
    
    ip_vs_conn_tab_bits may be provided by the user through the
    conn_tab_bits module parameter. If this value is greater than 31, or
    less than 0, the shift operator used to derive tab_size causes undefined
    behaviour.
    
    Fix this checking ip_vs_conn_tab_bits value to be in the range specified
    in ipvs Kconfig. If not, simply use default value.
    
    Fixes: 6f7edb4881bf ("IPVS: Allow boot time change of hash size")
    Reported-by: Yi Chen <yiche@xxxxxxxxxx>
    Signed-off-by: Andrea Claudi <aclaudi@xxxxxxxxxx>
    Acked-by: Julian Anastasov <ja@xxxxxx>
    Acked-by: Simon Horman <horms@xxxxxxxxxxxx>
    Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 5b2b17867cb1..2780a847701e 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -1399,6 +1399,10 @@ int __init ip_vs_conn_init(void)
 	int idx;
 
 	/* Compute size and mask */
+	if (ip_vs_conn_tab_bits < 8 || ip_vs_conn_tab_bits > 20) {
+		pr_info("conn_tab_bits not in [8, 20]. Using default value\n");
+		ip_vs_conn_tab_bits = CONFIG_IP_VS_TAB_BITS;
+	}
 	ip_vs_conn_tab_size = 1 << ip_vs_conn_tab_bits;
 	ip_vs_conn_tab_mask = ip_vs_conn_tab_size - 1;
 



[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