Skip to content

platforms/drm: Fix potential stack corruption

Vlad Zahorodnii requested to merge work/drm-poll into master

If the file descriptor of the DRM device is greater than FD_SETSIZE, the stack will be corrupted. However, it is highly unlikely that we ever hit this case because DRM devices are opened at startup of kwin, so the file descriptors should small.

In order to prevent the potential stack corruption, this change replaces the usage of select() with poll().

Unlike select(), the api of poll() is much more sensible. Back 20 or so years ago the main argument against poll() was that it's not implemented by all platforms. But, nowadays, it's supported on all major platforms.

Merge request reports