Skip to content

Fix fcntl64 EPERM for unknown FD - #1672

Closed
iMoD1998 wants to merge 1 commit into
qilingframework:devfrom
iMoD1998:fix/fcntl64-bad-fd-ebadf
Closed

iMoD1998 wants to merge 1 commit into
qilingframework:devfrom
iMoD1998:fix/fcntl64-bad-fd-ebadf

Conversation

@iMoD1998

@iMoD1998 iMoD1998 commented Nov 9, 2026

Copy link
Copy Markdown

Return -EBADF for invalid or unopened descriptors in ql_syscall_fcntl64, using get_opened_fd like ql_syscall_fcntl.

Previously, these failures returned raw -1, which libc interprets as EPERM.

Checklist

Which kind of PR do you create?

  • This PR only contains minor fixes.
  • This PR contains major feature update.
  • This PR introduces a new function/api for Qiling Framework.

Coding convention?

  • The new code conforms to Qiling Framework naming convention.
  • The imports are arranged properly.
  • Essential comments are added.
  • The reference of the new code is pointed out.

No additional comments or imports are needed.

Extra tests?

  • No extra tests are needed for this PR.
  • I have added enough tests for this PR.
  • Tests will be added after some discussion and review.

Manually checked invalid, unopened, and valid descriptors.

Changelog?

  • This PR doesn't need to update Changelog.
  • Changelog will be updated after some proper review.
  • Changelog has been updated in my PR.

Target branch?

  • The target branch is dev branch.

One last thing

@iMoD1998 iMoD1998 closed this Nov 9, 2026
@iMoD1998
iMoD1998 deleted the fix/fcntl64-bad-fd-ebadf branch November 9, 2026 14:30
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.

1 participant