summaryrefslogtreecommitdiff
path: root/fs/cifs/cifs_debug.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2018-05-24 09:53:39 +1000
committerSteve French <stfrench@microsoft.com>2018-05-30 16:06:18 -0500
commit25ad1cbd02fc9939089dafeb0a5698a7ca054237 (patch)
treedc3056baba3147fbf9e36856136fb65a2102c4d0 /fs/cifs/cifs_debug.c
parent57c55cd7c77b81827757fdbe8dda8c3927c52b4e (diff)
cifs: return error on invalid value written to cifsFYI
RHBZ: 1539617 Check that, if it is not a boolean, the value the user tries to write to /proc/fs/cifs/cifsFYI is valid and return an error if not. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com> Reported-by: Xiaoli Feng <xifeng@redhat.com>
Diffstat (limited to 'fs/cifs/cifs_debug.c')
-rw-r--r--fs/cifs/cifs_debug.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index e6025e93c5eb..ef93d60ca416 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -584,6 +584,8 @@ static ssize_t cifsFYI_proc_write(struct file *file, const char __user *buffer,
cifsFYI = bv;
else if ((c[0] > '1') && (c[0] <= '9'))
cifsFYI = (int) (c[0] - '0'); /* see cifs_debug.h for meanings */
+ else
+ return -EINVAL;
return count;
}