lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 11 Oct 2017 15:45:30 +0200
From:   Florian Westphal <fw@...len.de>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     Florian Westphal <fw@...len.de>, netdev <netdev@...r.kernel.org>,
        Dan Williams <dcbw@...hat.com>
Subject: Re: [PATCH v2 nf-next 1/2] netfilter: x_tables: make
 xt_replace_table wait until old rules are not used anymore

Eric Dumazet <edumazet@...gle.com> wrote:
> > +       /* ... so wait for even xt_recseq on all cpus */
> > +       for_each_possible_cpu(cpu) {
> > +               seqcount_t *s = &per_cpu(xt_recseq, cpu);
> > +
> > +               while (raw_read_seqcount(s) & 1)
> > +                       cpu_relax();
> > +
> > +               cond_resched();
> > +       }
> 
> It seems that we could also check :
> 
> 1) If low order bit of sequence is 0
>
> Or
> 
> 2) the value has changed
>        for_each_possible_cpu(cpu) {
>                 seqcount_t *s = &per_cpu(xt_recseq, cpu);
>                  u32 seq = raw_read_seqcount(s) ;
> 
>                  if (seq & 1) {
>                         do {
>                             cpu_relax();
>                           } while (seq == raw_read_seqcount(s));
> 

Actually I first used

for_each_possible_cpu(cpu) {
  seqcount_t *s = &per_cpu(xt_recseq, cpu);

  (void)__read_seqcount_begin(s);
}

but it looked confusing (not paired with a _retry function).
I'll respin with a loop like your suggestion above.  Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ