[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/9] libxl: poll: Avoid fd deregistration race POLLNVAL crash



On Thu, Jul 09, 2015 at 06:47:51PM +0100, Ian Jackson wrote:
> It can happen that an fd is deregistered, and closed, and then a new
> fd opened, and reregistered, all while another thread is in poll().
> 
> If this happens poll might report POLLNVAL, but the event loop would
> think that the fd was supposed to have been valid, and then fail an
> assertion:
>   libxl_event.c:1183: afterpoll_check_fd: Assertion `poller->fds_changed || 
> !(fds[slot].revents & 0x020)' failed.
> 
> We can't simply ignore POLLNVAL because if we have bugs which cause
> messed-up fds, it is a serious problem which we really need to detect.
> 
> Instead, add extra tracking to spot when this possibility arises, and
> abort on POLLNVAL if we are sure that it is unexpected.
> 
> Reported-by: Jim Fehlig <jfehlig@xxxxxxxx>
> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> CC: Jim Fehlig <jfehlig@xxxxxxxx>

Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.