]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ecryptfs: fix kernel panic with null dev_name
authorJeffrey Mitchell <jeffrey.mitchell@starlab.io>
Fri, 26 Feb 2021 21:00:23 +0000 (15:00 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:38:17 +0000 (10:38 +0200)
commit038c6001dba71baaf5009861cfb044d5aef0ee71
tree01aadb7d42f599d0e3e794d20633a2115e4330ef
parent3a0cadd433491b7277fc38d100fdce0fddddd983
ecryptfs: fix kernel panic with null dev_name

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@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>
fs/ecryptfs/main.c