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]
Date:   Tue, 20 Jun 2017 12:43:31 -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 v4 12/18] xen/pvcalls: implement poll command


> @@ -499,6 +521,55 @@ static int pvcalls_back_accept(struct xenbus_device *dev,
>  static int pvcalls_back_poll(struct xenbus_device *dev,
>  			     struct xen_pvcalls_request *req)
>  {
> +	struct pvcalls_fedata *fedata;
> +	struct sockpass_mapping *mappass;
> +	struct xen_pvcalls_response *rsp;
> +	struct inet_connection_sock *icsk;
> +	struct request_sock_queue *queue;
> +	unsigned long flags;
> +	int ret;
> +	bool data;
> +
> +	fedata = dev_get_drvdata(&dev->dev);
> +
> +	mappass = radix_tree_lookup(&fedata->socketpass_mappings, req->u.poll.id);
> +	if (mappass == NULL)
> +		return -EINVAL;
> +
> +	/*
> +	 * Limitation of the current implementation: only support one
> +	 * concurrent accept or poll call on one socket.
> +	 */
> +	spin_lock_irqsave(&mappass->copy_lock, flags);
> +	if (mappass->reqcopy.cmd != 0) {
> +		ret = -EINTR;
> +		goto out;
> +	}
> +
> +	mappass->reqcopy = *req;
> +	icsk = inet_csk(mappass->sock->sk);
> +	queue = &icsk->icsk_accept_queue;
> +	spin_lock(&queue->rskq_lock);
> +	data = queue->rskq_accept_head != NULL;
> +	spin_unlock(&queue->rskq_lock);

What is the purpose of the queue lock here?

-boris

> +	if (data) {
> +		mappass->reqcopy.cmd = 0;
> +		ret = 0;
> +		goto out;
> +	}
> +	spin_unlock_irqrestore(&mappass->copy_lock, flags);
> +
> +	/* Tell the caller we don't need to send back a notification yet */
> +	return -1;
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ