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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 06 Jun 2019 10:27:10 +0200
From:   Paolo Abeni <pabeni@...hat.com>
To:     David Miller <davem@...emloft.net>
Cc:     netdev@...r.kernel.org, mcroce@...hat.com
Subject: Re: [PATCH net] pktgen: do not sleep with the thread lock held.

Hi,

Thank you for the feedback.

On Wed, 2019-06-05 at 12:05 -0700, David Miller wrote:
> From: Paolo Abeni <pabeni@...hat.com>
> Date: Wed,  5 Jun 2019 14:34:46 +0200
> 
> > @@ -3062,20 +3062,49 @@ static int thread_is_running(const struct pktgen_thread *t)
> >       return 0;
> >  }
> >  
> > -static int pktgen_wait_thread_run(struct pktgen_thread *t)
> > +static bool pktgen_lookup_thread(struct pktgen_net *pn, struct pktgen_thread *t)
> > +{
> > +     struct pktgen_thread *tmp;
> > +
> > +     list_for_each_entry(tmp, &pn->pktgen_threads, th_list)
> > +             if (tmp == t)
> > +                     return true;
> > +     return false;
> > +}
> 
> Pointer equality is not object equality.

Indeed. The trick is that pktgen threads are allocated only at net
creation time.

Actaully they are also freed only net exit, so the extra care is not
needed: the current process held a reference to net via fs proxy.

I'll send a v2 cleaning up the unneeded parts and some documenting
comments.

Cheers,

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ