Patch "netlink: remove hash::nelems check in netlink_insert" 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

    netlink: remove hash::nelems check in netlink_insert

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:
     netlink-remove-hash-nelems-check-in-netlink_insert.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 cf480de4d9c8f5e63a97d470d48f8f25f2e7a01c
Author: Li RongQing <lirongqing@xxxxxxxxx>
Date:   Tue Sep 11 09:05:01 2018 +0800

    netlink: remove hash::nelems check in netlink_insert
    
    [ Upstream commit 0041195d55bc38df6b574cc8c36dcf2266fbee39 ]
    
    The type of hash::nelems has been changed from size_t to atom_t
    which in fact is int, so not need to check if BITS_PER_LONG, that
    is bit number of size_t, is bigger than 32
    
    and rht_grow_above_max() will be called to check if hashtable is
    too big, ensure it can not bigger than 1<<31
    
    Signed-off-by: Zhang Yu <zhangyu31@xxxxxxxxx>
    Signed-off-by: Li RongQing <lirongqing@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Stable-dep-of: c1bb9484e3b0 ("netlink: annotate data races around nlk->portid")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 6ffa83319d08..966c709c3831 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -578,11 +578,6 @@ static int netlink_insert(struct sock *sk, u32 portid)
 	if (nlk_sk(sk)->bound)
 		goto err;
 
-	err = -ENOMEM;
-	if (BITS_PER_LONG > 32 &&
-	    unlikely(atomic_read(&table->hash.nelems) >= UINT_MAX))
-		goto err;
-
 	nlk_sk(sk)->portid = portid;
 	sock_hold(sk);
 



[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