Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25ad1cbd authored by Ronnie Sahlberg's avatar Ronnie Sahlberg Committed by Steve French
Browse files

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: default avatarRonnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Reported-by: default avatarXiaoli Feng <xifeng@redhat.com>
parent 57c55cd7
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -584,6 +584,8 @@ static ssize_t cifsFYI_proc_write(struct file *file, const char __user *buffer,
		cifsFYI = bv;
		cifsFYI = bv;
	else if ((c[0] > '1') && (c[0] <= '9'))
	else if ((c[0] > '1') && (c[0] <= '9'))
		cifsFYI = (int) (c[0] - '0'); /* see cifs_debug.h for meanings */
		cifsFYI = (int) (c[0] - '0'); /* see cifs_debug.h for meanings */
	else
		return -EINVAL;


	return count;
	return count;
}
}