]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: fix msk traversal in mptcp_nl_cmd_set_flags()
authorPaolo Abeni <pabeni@redhat.com>
Fri, 21 Jan 2022 00:35:27 +0000 (16:35 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Jan 2022 04:24:01 +0000 (20:24 -0800)
commite8931b75c4cf0c94e6f3b773cf8f25f3e1bde7a8
tree913b1e25fa9640456d738fe957b7fe205cd6f542
parent9110b70ca299ee9e9a3d66740f758145887808be
mptcp: fix msk traversal in mptcp_nl_cmd_set_flags()

The MPTCP endpoint list is under RCU protection, guarded by the
pernet spinlock. mptcp_nl_cmd_set_flags() traverses the list
without acquiring the spin-lock nor under the RCU critical section.

This change addresses the issue performing the lookup and the endpoint
update under the pernet spinlock.

Fixes: fb1bfe931400 ("mptcp: add set_flags command in PM netlink")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm_netlink.c