[fxfs] Allow connections with writable rights to verified files

Remove restriction on *opening* verified files as writable. This does
**not** allow writing or resizing these files however, nor does it allow
any kind of operation that mutates the file's data.

While adding support in fxfs for the new fuchsia.io Open3 method, we
missed a check when opening a file that disallows opening as writable.
In practice writes still fail since we mark the handle as read-only.

Furthermore in Starnix, we keep handles to files cached, so we already
were keeping writable handles around. We enforce writability on handles
differently in Starnix as well. Starnix has used Open3, so it
effectively bypassed this check for quite some time.

We have additional access checks in Starnix that prevent opening a
verified file with O_RDWR or O_WRONLY, and additional checks in fxfs
that disallow write or resize operations.

Test: fx test fuchsia-pkg://fuchsia.com/fxfs-tests#meta/fxfs-platform-test.cm

Change-Id: I1d7dae6ffbde889d784c8c9aa8dea18d0d699afb
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1206305
Reviewed-by: Nikita Jindal <nikitajindal@google.com>
Commit-Queue: Brandon Castellano <bcastell@google.com>
2 files changed
tree: fec8f6c3a9f9443197478d578b81aa2b2b40a24d
  1. .helix/
  2. boards/
  3. build/
  4. bundles/
  5. docs/
  6. examples/
  7. infra/
  8. products/
  9. scripts/
  10. sdk/
  11. src/
  12. third_party/
  13. tools/
  14. zircon/
  15. .clang-format
  16. .clang-tidy
  17. .editorconfig
  18. .git-blame-ignore-revs
  19. .gitattributes
  20. .gitignore
  21. .gitmodules
  22. .gn
  23. .ignore
  24. analysis_options.yaml
  25. AUTHORS
  26. BUILD.gn
  27. CODE_OF_CONDUCT.md
  28. CONTRIBUTING.md
  29. fuchsia.code-workspace
  30. LICENSE
  31. OWNERS
  32. PATENTS
  33. pyproject.toml
  34. pyrightconfig.json
  35. README.md
  36. rustfmt.toml
  37. shac.star
  38. shac.textproto
README.md

Fuchsia

What is Fuchsia?

Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.

We expect everyone interacting with our project to respect our code of conduct.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.