mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
ecryptfs: fix kernel panic with null dev_name
commit9046625511
upstream. When mounting eCryptfs, a null "dev_name" argument to ecryptfs_mount() causes a kernel panic if the parsed options are valid. The easiest way to reproduce this is to call mount() from userspace with an existing eCryptfs mount's options and a "source" argument of 0. Error out if "dev_name" is null in ecryptfs_mount() Fixes:237fead619
("[PATCH] ecryptfs: fs/Makefile and fs/Kconfig") Cc: stable@vger.kernel.org Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io> Signed-off-by: Tyler Hicks <code@tyhicks.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3ad1fb9761
commit
6b5aeb69bb
1 changed files with 6 additions and 0 deletions
|
@ -492,6 +492,12 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (!dev_name) {
|
||||
rc = -EINVAL;
|
||||
err = "Device name cannot be null";
|
||||
goto out;
|
||||
}
|
||||
|
||||
rc = ecryptfs_parse_options(sbi, raw_data, &check_ruid);
|
||||
if (rc) {
|
||||
err = "Error parsing options";
|
||||
|
|
Loading…
Reference in a new issue