From: Oliver Neukum <oneukum@suse.com>
Date: Thu, 8 Sep 2016 11:27:30 +0200
Subject: cdc-acm: added sanity checking for probe()
-To: stable@vger.kernel.org, jslaby@suse.com
+To: <jslaby@suse.com>
Cc: Oliver Neukum <oneukum@suse.com>
Message-ID: <1473326850-5056-1-git-send-email-oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- fs/crypto/policy.c | 3 +++
- 1 file changed, 3 insertions(+)
+ fs/crypto/policy.c | 3 +++
+ fs/ext4/crypto_policy.c | 3 +++
+ 2 files changed, 6 insertions(+)
--- a/fs/crypto/policy.c
+++ b/fs/crypto/policy.c
if (policy->version != 0)
return -EINVAL;
+--- a/fs/ext4/crypto_policy.c
++++ b/fs/ext4/crypto_policy.c
+@@ -102,6 +102,9 @@ static int ext4_create_encryption_contex
+ int ext4_process_policy(const struct ext4_encryption_policy *policy,
+ struct inode *inode)
+ {
++ if (!inode_owner_or_capable(inode))
++ return -EACCES;
++
+ if (policy->version != 0)
+ return -EINVAL;
+