Skip to contentSkip to conversation

ubifs: allow encryption ioctls in compat mode

PATCH In review Eric Biggers 2 participants 2 messages Dec 19, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ubifs: allow encryption ioctls in compat mode

From: Eric Biggers <[email protected]>

The ubifs encryption ioctls did not work when called by a 32-bit program on a 64-bit kernel. Since 'struct fscrypt_policy' is not affected by the word size, ubifs just needs to allow these ioctls through, like what ext4 and f2fs do.

---
 fs/ubifs/ioctl.c | 3 +++
 1 file changed, 3 insertions(+)
fs/ubifs/ioctl.c +3 -0
index 78d7136..da519ba 100644
@@ -217,6 +217,9 @@ long ubifs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	case FS_IOC32_SETFLAGS:
 		cmd = FS_IOC_SETFLAGS;
 		break;
+	case FS_IOC_SET_ENCRYPTION_POLICY:
+	case FS_IOC_GET_ENCRYPTION_POLICY:
+		break;
 	default:
 		return -ENOIOCTLCMD;
 	}
Signature · 1 line
2.8.0.rc3.226.g39d4020
#1 lore raw
Quoted 17 lines · Eric Biggers

From: Eric Biggers <[email protected]>

The ubifs encryption ioctls did not work when called by a 32-bit program on a 64-bit kernel. Since 'struct fscrypt_policy' is not affected by the word size, ubifs just needs to allow these ioctls through, like what ext4 and f2fs do.

---
 fs/ubifs/ioctl.c | 3 +++
 1 file changed, 3 insertions(+)
fs/ubifs/ioctl.c +0 -0
index 78d7136..da519ba 100644

fs/ubifs/ioctl.c long ubifs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · line 222

Quoted 6 lines
fs/ubifs/ioctl.c +3 -0
@@ -217,6 +217,9 @@ long ubifs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	case FS_IOC32_SETFLAGS:
 		cmd = FS_IOC_SETFLAGS;
 		break;
+	case FS_IOC_SET_ENCRYPTION_POLICY:
+	case FS_IOC_GET_ENCRYPTION_POLICY:
+		break;

Whoops, since I tested most of the time on an ARM board, this was unnoticed. :-D

Thanks,
//richard