This is a note to let you know that I've just added the patch titled ecryptfs: fix kernel panic with null dev_name to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ecryptfs-fix-kernel-panic-with-null-dev_name.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 9046625511ad8dfbc8c6c2de16b3532c43d68d48 Mon Sep 17 00:00:00 2001 From: Jeffrey Mitchell <jeffrey.mitchell@xxxxxxxxxx> Date: Fri, 26 Feb 2021 15:00:23 -0600 Subject: ecryptfs: fix kernel panic with null dev_name From: Jeffrey Mitchell <jeffrey.mitchell@xxxxxxxxxx> 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@xxxxxxxxxxxxxxx Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@xxxxxxxxxx> Signed-off-by: Tyler Hicks <code@xxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- 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"; Patches currently in stable-queue which might be from jeffrey.mitchell@xxxxxxxxxx are queue-5.4/ecryptfs-fix-kernel-panic-with-null-dev_name.patch