[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210510102010.777714351@linuxfoundation.org>
Date: Mon, 10 May 2021 12:16:50 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Jeffrey Mitchell <jeffrey.mitchell@...rlab.io>,
Tyler Hicks <code@...icks.com>
Subject: [PATCH 5.11 020/342] ecryptfs: fix kernel panic with null dev_name
From: Jeffrey Mitchell <jeffrey.mitchell@...rlab.io>
commit 9046625511ad8dfbc8c6c2de16b3532c43d68d48 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: 237fead61998 ("[PATCH] ecryptfs: fs/Makefile and fs/Kconfig")
Cc: stable@...r.kernel.org
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@...rlab.io>
Signed-off-by: Tyler Hicks <code@...icks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/ecryptfs/main.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -492,6 +492,12 @@ static struct dentry *ecryptfs_mount(str
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";
Powered by blists - more mailing lists