On Tue, Nov 27, 2012 at 02:09:04PM +0100, Florian Westphal wrote: > Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote: > > > > 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? > > > > while updating the connlabel via memcpy, some test_bit on the > > connlabel may be already happening. I was suggesting some way to avoid > > racing with it. > > I don't understand why its racing. > > Is there a case where we update a word, and test_bit can return > "bit is set", even if the bit in the word is neither currently > set nor about to be set? > > If not, then I don't see the race; either the test happens > before we copied the word, or afterwards; regardless of copy vs. > xchg? I was thinking on the case in which we are setting bits via the connlabel extension and modifying this from ctnetlink at the same time. But I don't see any way to make it any better, I think your approach is fine for the update case. -- 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