Skip to content

libglnx: Retry openat2 on EAGAIN in glnx_chaseat_full - #6786

Closed
CleoMenezesJr wants to merge 1 commit into
flatpak:mainfrom
CleoMenezesJr:fix-glnx-chaseat-eagain
Closed

CleoMenezesJr wants to merge 1 commit into
flatpak:mainfrom
CleoMenezesJr:fix-glnx-chaseat-eagain

Conversation

@CleoMenezesJr

Copy link
Copy Markdown

openat2 with RESOLVE_BENEATH can fail with EAGAIN when the kernel cannot guarantee that a ".." component did not escape (race condition or potential attack), as documented in openat2(2). Flatpak launches intermittently abort with "Extension ... has invalid merge-dirs" when this happens while opening GL extension merge-dirs.

Retry the syscall on EAGAIN, as suggested by @swick . The race resolves in a few iterations in practice.

openat2 with RESOLVE_BENEATH may fail with EAGAIN when a ".." component
cannot be resolved without escaping (openat2(2)). Flatpak then aborts
the launch with "Extension ... has invalid merge-dirs", which is
intermittent since the failure is transient.

Retry the call on EAGAIN. Verified against the race: 8 launches, 2
EAGAINs, no crash (previously ~3/5 launches crashed).

Closes flatpak#6783

Co-authored-by: Sebastian Wick <[email protected]>
@CleoMenezesJr
CleoMenezesJr force-pushed the fix-glnx-chaseat-eagain branch from bee3467 to db79045 Compare August 18, 2026 17:36
@swick

swick commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

libglnx is a subproject. Patch is already up there https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/79. We need to bump the subproject checkout though when it gets merged in libglnx.

@swick swick closed this Aug 18, 2026
@swick

swick commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

It's actually a git subtree, but same issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants