Skip to content

mds: add protection from clients without fscrypt support#54725

Closed
lxbsz wants to merge 7 commits intoceph:mainfrom
lxbsz:fscrypt-pro-clients
Closed

mds: add protection from clients without fscrypt support#54725
lxbsz wants to merge 7 commits intoceph:mainfrom
lxbsz:fscrypt-pro-clients

Conversation

@lxbsz
Copy link
Member

@lxbsz lxbsz commented Nov 30, 2023

Clients that do not support fscrypt can execute operations that may cause unrecoverable data loss. Add protection on the MDS so that it prevents these clients from executing some operations.

Note, however, that clients will still be able corrupt encrypted files by appending data to them. And they will still be able to read encrypted data from those files.

This PR originally from @luis-henrix 's PR #45073. And I just fix the lock order issue, and will run more tests for it.

Please note this PR will fix one issue from Luis' previous PR:

1, MDS crash issue https://tracker.ceph.com/issues/63685

Fixes: https://tracker.ceph.com/issues/65217

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@lxbsz lxbsz requested review from a team, luis-henrix and vshankar November 30, 2023 01:23
@github-actions github-actions bot added the cephfs Ceph File System label Nov 30, 2023
@lxbsz lxbsz force-pushed the fscrypt-pro-clients branch from cfc098d to a8643cd Compare November 30, 2023 01:24
@lxbsz lxbsz force-pushed the fscrypt-pro-clients branch from a8643cd to d3de83d Compare November 30, 2023 09:44
@lxbsz
Copy link
Member Author

lxbsz commented Dec 1, 2023

Locally the xfstests passed.

@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

1 similar comment
@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@vshankar
Copy link
Contributor

@lxbsz Is this ready for review?

@lxbsz
Copy link
Member Author

lxbsz commented Jan 18, 2024

@lxbsz Is this ready for review?

@vshankar Yeah, it's ready.

Copy link
Contributor

@chrisphoffman chrisphoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to see there's been discussion about server side semantics enforcement.

Do we need any tests included in this PR to ensure our intended behavior doesn't change? We can't one day inadvertently allow older or non-friendly clients to be able to do known malicious things.

@lxbsz
Copy link
Member Author

lxbsz commented Feb 26, 2024

I'm happy to see there's been discussion about server side semantics enforcement.

Do we need any tests included in this PR to ensure our intended behavior doesn't change?

Yeah, we need to run qa.

@chrisphoffman
Copy link
Contributor

I'm happy to see there's been discussion about server side semantics enforcement.
Do we need any tests included in this PR to ensure our intended behavior doesn't change?

Yeah, we need to run qa.

To be more specific, I was proposing new tests. For example testing a client working on a fscrypt tree that the client doesn't know about fscrypt. We want to make sure server enforced behavior fails on unaware clients. What do you think?

Do we already test this? If so, can you point me to it?

@lxbsz
Copy link
Member Author

lxbsz commented Feb 27, 2024

I'm happy to see there's been discussion about server side semantics enforcement.
Do we need any tests included in this PR to ensure our intended behavior doesn't change?

Yeah, we need to run qa.

To be more specific, I was proposing new tests. For example testing a client working on a fscrypt tree that the client doesn't know about fscrypt. We want to make sure server enforced behavior fails on unaware clients. What do you think?

Do we already test this? If so, can you point me to it?

Hmm, sounds reasonable to me. Currently there has not thus test yet.

@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@lxbsz lxbsz force-pushed the fscrypt-pro-clients branch from fdc897f to 06b547d Compare March 26, 2024 01:47
@vshankar
Copy link
Contributor

This PR is under test in https://tracker.ceph.com/issues/68092.

joscollin pushed a commit to joscollin/ceph that referenced this pull request Sep 23, 2024
* refs/pull/54725/head:
	qa/fscrypt: add fscrypt protection test cases
	qa/fscrypt: fix the incorrect option name
	qa/fscrypt: add the dedicated dir for fscrypt basic tests
	mds: add client dedicated features macro
	client: fix incorrectly handling the fscrypt_file bug
	mds: add open trunc protection from clients without fscrypt support
	mds: add protection from clients without fscrypt support

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Christopher Hoffman <choffman@redhat.com>
@vshankar
Copy link
Contributor

vshankar commented Oct 7, 2024

Dropping my testing tag since I'm still running into failures which seem related. Will have to debug.

@chrisphoffman chrisphoffman self-requested a review October 8, 2024 12:59
@vshankar vshankar removed their assignment Nov 5, 2024
@github-actions
Copy link

github-actions bot commented Jan 4, 2025

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Jan 4, 2025
@dparmar18 dparmar18 removed the stale label Jan 6, 2025
@dparmar18
Copy link
Contributor

Dropping my testing tag since I'm still running into failures which seem related. Will have to debug.

@vshankar are we moving ahead with this?

@vshankar
Copy link
Contributor

vshankar commented Jan 6, 2025

Dropping my testing tag since I'm still running into failures which seem related. Will have to debug.

@vshankar are we moving ahead with this?

We need to, but the failure that I saw in the test run isn't debugged and @chrisphoffman will have a look.

@vshankar
Copy link
Contributor

bumping this up for @chrisphoffman

@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@chrisphoffman
Copy link
Contributor

bumping this up for @chrisphoffman

Got it, added to fscrypt master tracker todo list: https://tracker.ceph.com/issues/65217

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Apr 26, 2025
@github-actions
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions bot closed this May 26, 2025
@dparmar18 dparmar18 removed the stale label May 26, 2025
@dparmar18 dparmar18 reopened this May 26, 2025
@dparmar18
Copy link
Contributor

@chrisphoffman @vshankar @batrick are we still working on this?

@vshankar
Copy link
Contributor

@chrisphoffman @vshankar @batrick are we still working on this?

Not sure what you mean. We need this change to ensure that non-fscrypt clients cannot mangle encrypted files/directories.

@vshankar vshankar closed this May 26, 2025
@vshankar vshankar reopened this May 26, 2025
@vshankar
Copy link
Contributor

(closed by mistake -- reopened)

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Jul 25, 2025
@github-actions
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions bot closed this Aug 24, 2025
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.

5 participants