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] [thread-next>] [day] [month] [year] [list]
Message-ID: <bb6fe01c-018c-811b-f728-2abef74cfb75@oracle.com>
Date:   Fri, 26 May 2017 14:18:07 -0400
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     Stefano Stabellini <sstabellini@...nel.org>,
        xen-devel@...ts.xen.org
Cc:     linux-kernel@...r.kernel.org, jgross@...e.com,
        Stefano Stabellini <stefano@...reto.com>
Subject: Re: [PATCH v2 11/18] xen/pvcalls: implement accept command


>  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?

-boris

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ