Project

General

Profile

Actions

Feature #47161

closed

mds: add dedicated field to inode for fscrypt context

Added by Jeff Layton over 3 years ago. Updated over 3 years ago.

Status:
Rejected
Priority:
High
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
Reviewed:
Affected Versions:
Component(FS):
MDS, libcephfs
Labels (FS):
Pull request ID:

Description

fscrypt requires that each encrypted inode contain an encryption context:

https://www.kernel.org/doc/html/latest/filesystems/fscrypt.html#encryption-context

Usually this is stored in an xattr (and that is what the prototype code so far does), but I think that's probably not ideal for cephfs:

  1. this info will (almost) never change once the inode is created
  2. the clients will always need this if it's present, so we probably don't want this under xattr caps
  3. we're going to want the MDS to block legacy clients from accessing fscrypted directories so the MDS will need to know whether this attr is present for some things, and that's simpler if we don't have to deal with xattrs

What I think we need at this point is a new field in the inode that is set to the crypto context. While these don't change often, we do need to allow them to be changed for some of the ioctls (particularly when adding a new crypto context when encrypting a new directory). So, we'd need the ability to change this with a SETATTR call as well. It seems like this might appropriately be under the aegis of auth caps.

With modern code, the contexts should be ~16 bytes, but eventually they could be expanded, so we should assume that they could be larger in the future.

Actions

Also available in: Atom PDF