Skip to content

Reject unsupported flags in RV64 Linux newfstatat - #1702

Open
carlosqwqqwq wants to merge 1 commit into
qilingframework:devfrom
carlosqwqqwq:codex/qiling-issue-1684-newfstatat-flags-20261124
Open

carlosqwqqwq wants to merge 1 commit into
qilingframework:devfrom
carlosqwqqwq:codex/qiling-issue-1684-newfstatat-flags-20261124

Conversation

@carlosqwqqwq

Copy link
Copy Markdown

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 below.

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.

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

Summary

newfstatat currently accepts unknown flag bits and can continue through path lookup and output serialization. This validates the Linux 32-bit flag argument against the supported set first, returning EINVAL for unsupported bits before touching the output buffer.

Fixes #1684.

Validation

  • cd tests && PYTHONPATH=.. python3 -m unittest test_newfstatat_flags — passed.
  • cd tests && PYTHONPATH=.. python3 test_posix.py TestNewfstatatFlags — passed.
  • Both commands passed in Python 3.11 and Python 3.13 containers.
  • The RV64 guest patch-after on Qiling dev and v1.4.11 returned -EINVAL and preserved the output sentinel in all three trials per version.
  • The full project suite and upstream CI have not been run locally.

References

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