From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] xenconsole: merge pty access check into when it is opened Date: Mon, 2 Dec 2013 11:53:46 +0000 Message-ID: <529C74CA.6020606@citrix.com> References: <1385782972-22793-1-git-send-email-mattd@bugfuzz.com> <529B2086.1080804@citrix.com> <529BC659.8010602@citrix.com> <21148.29748.198188.50940@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21148.29748.198188.50940@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Matthew Daley , Ian Campbell , Stefano Stabellini , Xen-devel List-Id: xen-devel@lists.xenproject.org On 02/12/13 11:51, Ian Jackson wrote: > Andrew Cooper writes ("Re: [Xen-devel] [PATCH] xenconsole: merge pty access check into when it is opened"): >> On 01/12/2013 23:14, Matthew Daley wrote: >>> On Mon, Dec 2, 2013 at 12:41 AM, Andrew Cooper >>> wrote: >>>> access() can fail for many more reasons than just EACCES. I would skip >>>> the errno check entirely and always print the error. >>> err() doesn't return though (calls exit()). Given that, is always >>> calling it still acceptable? > ... >> Even as the patch currently stands, the behaviour of the loop has >> changed. Before, it would eat any error from access(), and only die in >> the toctou case where open() subsequently failed. > I had the impression there is sometimes a race during domain startup, > between a toolstack invoking xenconsole and xenconsoled allocating the > pty. > > Ian. In which case the xenstore path should be NULL and we wander around loop and wait on the watch again. ~Andrew