Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote: > > +#if IS_ENABLED(CONFIG_NF_CT_NETLINK) > > +int nfnetlink_connlabel_set(struct nf_conn *ct, const void *data, unsigned int length) > > +{ [..] > > + labels = nf_ct_labels_find(ct); > > + if (!labels) > > + return -ENOSPC; [..] > Via ctnetlink_new_conntrack, we should be able to create and set the > connlabel if we want to support state-sync of connlabels. Right. Good point. > That requires calling _ext_add(...) to allocate the label, based on > cda[CTA_LABELS], and set it. In that case we're safe to memcpy without > interfering with any ongoing bit testing since that conntrack is not > in the hashes yet. True. So we can't race with other _ext_add() callers either. I'll add this functionality, thanks for pointing this out. > For the update case, I think we'll have to iterate over the mask and > use xchg to update words, thus, we avoid any interference ongoing bit > testing. Could you elaborate? Why is memcpy not good enough here? -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html