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]
Message-ID: <alpine.DEB.2.10.1706021219340.18759@sstabellini-ThinkPad-X260>
Date:   Fri, 2 Jun 2017 12:19:41 -0700 (PDT)
From:   Stefano Stabellini <sstabellini@...nel.org>
To:     Boris Ostrovsky <boris.ostrovsky@...cle.com>
cc:     Stefano Stabellini <sstabellini@...nel.org>,
        xen-devel@...ts.xen.org, linux-kernel@...r.kernel.org,
        jgross@...e.com, Stefano Stabellini <stefano@...reto.com>
Subject: Re: [PATCH v2 11/18] xen/pvcalls: implement accept command

On Fri, 26 May 2017, Boris Ostrovsky wrote:
> >  static void __pvcalls_back_accept(struct work_struct *work)
> >  {
> > +	struct sockpass_mapping *mappass = container_of(
> > +		work, struct sockpass_mapping, register_work);
> > +	struct sock_mapping *map;
> > +	struct pvcalls_ioworker *iow;
> > +	struct pvcalls_back_priv *priv;
> > +	struct xen_pvcalls_response *rsp;
> > +	struct xen_pvcalls_request *req;
> > +	void *page = NULL;
> > +	int notify;
> > +	int ret = -EINVAL;
> > +	unsigned long flags;
> > +
> > +	priv = mappass->priv;
> > +	/* We only need to check the value of "cmd" atomically on read. */
> > +	spin_lock_irqsave(&mappass->copy_lock, flags);
> > +	req = &mappass->reqcopy;
> > +	if (req->cmd != PVCALLS_ACCEPT) {
> > +		spin_unlock_irqrestore(&mappass->copy_lock, flags);
> > +		return;
> > +	}
> > +	spin_unlock_irqrestore(&mappass->copy_lock, flags);
> > +
> > +	map = kzalloc(sizeof(*map), GFP_KERNEL);
> 
> >From here on, the code looks almost identical to connect. Can this be
> factored out?

Yes, good idea, I'll do that

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ