gramineproject / graphene

Graphene / Graphene-SGX - a library OS for Linux multi-process applications, with Intel SGX support
https://grapheneproject.io
GNU Lesser General Public License v3.0
771 stars 261 forks source link

[LibOS] Fix poll() crashing on pseudo-files #2498

Closed pwmarcz closed 3 years ago

pwmarcz commented 3 years ago

Found when investigating stress-ng (#2419).

Description of the changes

The code assumed that all handles (other than TYPE_FILE and TYPE_DEV) had an associated PAL handle, which caused a crash when polling files from /proc. This change adds support for polling TYPE_STR, and also adds a check for PAL handle in all cases.

(I think poll deserves a bigger rewrite, this is just a quick fix).

How to test this PR?


This change is Reviewable