[PATCH] os: make sure the clientsWritable fd_set is initialized before use

Alan Coopersmith alan.coopersmith at oracle.com
Mon Aug 24 10:46:53 PDT 2015


On 08/23/15 11:05 AM, Keith Packard wrote:
> Martin Peres <martin.peres at free.fr> writes:
>
>> We have been discussing in private with Keith. It seems like the both of
>> us do not have the time to properly fix the issue. I would say let's
>> push this fix and get rid of all this complexity later! I really do not
>> see when I will have the time for it and this patch is doing the right
>> thing, even if it is not addressing the complexity issue which means it
>> will blow in our faces again later on unless someone takes the time to
>> properly fix it!
>
> It seems like a simpler fix would be to revert the change to x11proto that
> caused this problem in the first place; given that the X server will not
> ever use more than MAXCLIENTS fds for devices and clients, there doesn't
> seem to be any value in having x11proto allocate larger arrays of fd
> masks for select.

I don't know if it still works, but os/connection.c still has a
ClientTranslation layer for an OS that didn't use the client fd
for the client id, and thus could go beyond MAXCLIENTS.

We should probably also add checks at some point to functions like
AddGeneralSocket() that takes file descriptors from other code and
adds them to the select() mask to make sure they're < XFD_SETSIZE.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list