]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
netfilter: nft_socket: remove WARN_ON_ONCE on maximum cgroup level
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 26 Nov 2024 10:59:06 +0000 (11:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:03:03 +0000 (20:03 +0100)
[ Upstream commit b7529880cb961d515642ce63f9d7570869bbbdc3 ]

cgroup maximum depth is INT_MAX by default, there is a cgroup toggle to
restrict this maximum depth to a more reasonable value not to harm
performance. Remove unnecessary WARN_ON_ONCE which is reachable from
userspace.

Fixes: 7f3287db6543 ("netfilter: nft_socket: make cgroupsv2 matching work with namespaces")
Reported-by: syzbot+57bac0866ddd99fe47c0@syzkaller.appspotmail.com
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_socket.c

index f5da0c1775f2e7fd5ba108b70facc06cbf7180e1..35d0409b009501661d8b668889efeb100b0db737 100644 (file)
@@ -68,7 +68,7 @@ static noinline int nft_socket_cgroup_subtree_level(void)
 
        cgroup_put(cgrp);
 
-       if (WARN_ON_ONCE(level > 255))
+       if (level > 255)
                return -ERANGE;
 
        if (WARN_ON_ONCE(level < 0))