ima: Remove ima_policy file before directory
authorStefan Berger <stefanb@linux.ibm.com>
Tue, 25 Jan 2022 22:46:23 +0000 (17:46 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Feb 2022 11:56:03 +0000 (12:56 +0100)
commit20805cdf95af0c64e428ee4b7e2cefa27abbe375
treef7564b95a7eab88c08b77d388b1afb52b170a2dc
parent0838d6d68182f0b28a5434bc6d50727c4757e35b
ima: Remove ima_policy file before directory

commit f7333b9572d0559e00352a926c92f29f061b4569 upstream.

The removal of ima_dir currently fails since ima_policy still exists, so
remove the ima_policy file before removing the directory.

Fixes: 4af4662fa4a9 ("integrity: IMA policy")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/integrity/ima/ima_fs.c