openvswitch: get related ct labels from its master if it is not confirmed
authorXin Long <lucien.xin@gmail.com>
Wed, 19 Jun 2024 22:08:56 +0000 (18:08 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Jun 2024 09:17:30 +0000 (10:17 +0100)
commita23ac973f67f37e77b3c634e8b1ad5b0164fcc1f
treedcae6ebba84bdbb0e9e2b5cb4f3543c9d0a6aed6
parentad53f5f54f351e967128edbc431f0f26427172cf
openvswitch: get related ct labels from its master if it is not confirmed

Ilya found a failure in running check-kernel tests with at_groups=144
(144: conntrack - FTP SNAT orig tuple) in OVS repo. After his further
investigation, the root cause is that the labels sent to userspace
for related ct are incorrect.

The labels for unconfirmed related ct should use its master's labels.
However, the changes made in commit 8c8b73320805 ("openvswitch: set
IPS_CONFIRMED in tmpl status only when commit is set in conntrack")
led to getting labels from this related ct.

So fix it in ovs_ct_get_labels() by changing to copy labels from its
master ct if it is a unconfirmed related ct. Note that there is no
fix needed for ct->mark, as it was already copied from its master
ct for related ct in init_conntrack().

Fixes: 8c8b73320805 ("openvswitch: set IPS_CONFIRMED in tmpl status only when commit is set in conntrack")
Reported-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
Tested-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/conntrack.c