]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ipvs: Guard access of HK_TYPE_KTHREAD cpumask with RCU
authorWaiman Long <longman@redhat.com>
Thu, 30 Apr 2026 07:44:19 +0000 (10:44 +0300)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 4 May 2026 23:52:55 +0000 (01:52 +0200)
commitaa6065206987278291c09d0c6aebed687114c925
tree4c9fadeaee70ac808dd986e0717a66d40e1bf2a9
parent4ee52b7021a7cb9356f8b9aff5631c68512a9e1b
ipvs: Guard access of HK_TYPE_KTHREAD cpumask with RCU

The ip_vs_ctl.c file and the associated ip_vs.h file are the only places
in the kernel where HK_TYPE_KTHREAD cpumask is being retrieved and used.
Now that HK_TYPE_KTHREAD/HK_TYPE_DOMAIN cpumask can be changed at run
time. We need to use RCU to guard access to this cpumask to avoid a
potential UAF problem as the returned cpumask may be freed before it
is being used.

We can replace HK_TYPE_KTHREAD by HK_TYPE_DOMAIN as they are aliases
of each other, but keeping the HK_TYPE_KTHREAD name can highlight the
fact that it is the kthread initiated by ipvs that is being controlled.

Fixes: 03ff73510169 ("cpuset: Update HK_TYPE_DOMAIN cpumask from cpuset")
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/ip_vs.h
net/netfilter/ipvs/ip_vs_ctl.c