Skip to content

Silence lseek() errors on fds inherited by extra-data helpers - #6609

Merged
smcv merged 2 commits into
flatpak:mainfrom
smcv:extra-data
Apr 12, 2026
Merged

smcv merged 2 commits into
flatpak:mainfrom
smcv:extra-data

Conversation

@smcv

@smcv smcv commented Apr 11, 2026

Copy link
Copy Markdown
Collaborator
  • bwrap: Clarify a comment

    Now that we're passing the app's /app and /usr down to bwrap as O_PATH
    file descriptors, it will be even more common to have non-seekable fds
    in the array.

  • dir: Use flatpak_bwrap_child_setup_inherit_fds_cb() to apply extra-data

    This is functionally equivalent to the local child_setup() deleted by
    this commit, except that it ignores lseek() errors, which can
    legitimately happen when inheriting a non-seekable file descriptor.
    Since commit ac62ebe "run: Use O_PATH fds for the runtime and app
    deploy directories", any extra-data helper that runs inside a runtime
    will receive a non-seekable O_PATH fd as its /usr.

    Resolves: [Bug]: "lseek error in child setup" while installing extra-data in 1.16.4+ #6608

smcv added 2 commits April 11, 2026 16:59
Now that we're passing the app's /app and /usr down to bwrap as O_PATH
file descriptors, it will be even more common to have non-seekable fds
in the array.

Signed-off-by: Simon McVittie <[email protected]>
This is functionally equivalent to the local child_setup() deleted by
this commit, except that it ignores lseek() errors, which can
legitimately happen when inheriting a non-seekable file descriptor.
Since commit ac62ebe "run: Use O_PATH fds for the runtime and app
deploy directories", any extra-data helper that runs inside a runtime
will receive a non-seekable O_PATH fd as its /usr.

Resolves: flatpak#6608
Signed-off-by: Simon McVittie <[email protected]>
@smcv smcv changed the title Ignore lseek() errors on fds inherited by extra-data helpers Silence lseek() errors on fds inherited by extra-data helpers Apr 11, 2026
@smcv
smcv marked this pull request as ready for review April 11, 2026 16:12
@smcv

smcv commented Apr 11, 2026

Copy link
Copy Markdown
Collaborator Author

cc @bertogg

@bertogg

bertogg commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Looks good to me, thanks

@smcv
smcv added this pull request to the merge queue Apr 12, 2026
Merged via the queue into flatpak:main with commit 333459c Apr 12, 2026
11 checks passed
@smcv
smcv deleted the extra-data branch April 12, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "lseek error in child setup" while installing extra-data in 1.16.4+

3 participants