summary refs log tree commit diff
path: root/seccomp
diff options
context:
space:
mode:
authorChirantan Ekbote <chirantan@chromium.org>2019-12-05 19:20:48 +0900
committerCommit Bot <commit-bot@chromium.org>2019-12-10 03:10:57 +0000
commit4f9f5c74791fd13f6930a48232b3327066259b8e (patch)
tree0bbbad8c69a96209fee1b75e6d8f1d6352b6ee16 /seccomp
parentf21572c7187c8beb9c6bfea6446351ae93200d01 (diff)
downloadcrosvm-4f9f5c74791fd13f6930a48232b3327066259b8e.tar
crosvm-4f9f5c74791fd13f6930a48232b3327066259b8e.tar.gz
crosvm-4f9f5c74791fd13f6930a48232b3327066259b8e.tar.bz2
crosvm-4f9f5c74791fd13f6930a48232b3327066259b8e.tar.lz
crosvm-4f9f5c74791fd13f6930a48232b3327066259b8e.tar.xz
crosvm-4f9f5c74791fd13f6930a48232b3327066259b8e.tar.zst
crosvm-4f9f5c74791fd13f6930a48232b3327066259b8e.zip
devices: fs: Support fs crypto ioctls
Add support for FS_IOC_{GET,SET}_ENCRYPTION_POLICY.  Unfortunately,
since the I/O direction is encoded backwards in the ioctl definitions,
these will only work with on a kernel that's compiled with a patch to
mark them as unrestricted FUSE ioctls.

BUG=b:136127632
TEST=Compile and run the vfs_crypto.c program on a virtio-fs mount
     inside a VM

Change-Id: I124c5a943111b453dd44921a079a2baa1036dfd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1952570
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Tested-by: Chirantan Ekbote <chirantan@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
Diffstat (limited to 'seccomp')
-rw-r--r--seccomp/arm/fs_device.policy1
-rw-r--r--seccomp/x86_64/fs_device.policy1
2 files changed, 2 insertions, 0 deletions
diff --git a/seccomp/arm/fs_device.policy b/seccomp/arm/fs_device.policy
index 0ea7fe0..0708ec8 100644
--- a/seccomp/arm/fs_device.policy
+++ b/seccomp/arm/fs_device.policy
@@ -16,6 +16,7 @@ ftruncate64: 1
 getdents64: 1
 getegid32: 1
 geteuid32: 1
+ioctl: arg1 == FS_IOC_GET_ENCRYPTION_POLICY || arg1 == FS_IOC_SET_ENCRYPTION_POLICY
 linkat: 1
 _llseek: 1
 mkdirat: 1
diff --git a/seccomp/x86_64/fs_device.policy b/seccomp/x86_64/fs_device.policy
index cbf0288..20db0bf 100644
--- a/seccomp/x86_64/fs_device.policy
+++ b/seccomp/x86_64/fs_device.policy
@@ -15,6 +15,7 @@ ftruncate: 1
 getdents64: 1
 getegid: 1
 geteuid: 1
+ioctl: arg1 == FS_IOC_GET_ENCRYPTION_POLICY || arg1 == FS_IOC_SET_ENCRYPTION_POLICY
 linkat: 1
 lseek: 1
 mkdirat: 1