mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
openvswitch: avoid reallocating confirmed conntrack labels
ovs_ct_get_conn_labels() adds the labels extension when a conntrack
entry does not have one. Confirmed conntracks can be read locklessly,
so adding an extension may reallocate and free the extension block
while another CPU accesses it.
Only add the extension for unconfirmed conntracks. A confirmed
conntrack without labels now fails the caller's label operation instead
of reallocating its extension storage.
Fixes: c2ac667358 ("openvswitch: Allow matching on conntrack label")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Link: https://patch.msgid.link/372fbb062b40ae6723684f55484be86ff0064f8e.1789218015.git.zhilinz@nebusec.ai
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
ad77dba64d
commit
3f118c8217
|
|
@ -366,7 +366,7 @@ static struct nf_conn_labels *ovs_ct_get_conn_labels(struct nf_conn *ct)
|
|||
struct nf_conn_labels *cl;
|
||||
|
||||
cl = nf_ct_labels_find(ct);
|
||||
if (!cl) {
|
||||
if (!cl && !nf_ct_is_confirmed(ct)) {
|
||||
nf_ct_labels_ext_add(ct);
|
||||
cl = nf_ct_labels_find(ct);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user