From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5488C433EF for ; Mon, 14 Feb 2022 09:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243025AbiBNJ2p (ORCPT ); Mon, 14 Feb 2022 04:28:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243073AbiBNJ2h (ORCPT ); Mon, 14 Feb 2022 04:28:37 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 373AF60D90; Mon, 14 Feb 2022 01:28:28 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C3BDDB80DC7; Mon, 14 Feb 2022 09:28:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F41A2C340E9; Mon, 14 Feb 2022 09:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644830905; bh=0WY8f51R/Y2rl4lHjqHCXNYYMMBguLRFJ5mUJaq5XnU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1PjIbJiRBQ5SIFrauq9tBrgwt7ZgSWwOYLLcyAOD9zu7l/9LSzWMmv4tH6k6xub4X hWRhDkN+4QpNIvw9bt3vAxu2qcvRJC0zL12cK8ne2B6wcIQv/1xTjWHOKzJeF2t9J1 ci+4mkSNmnEmoSeVV2SLWNxoqI/lNKbuSYCjcah4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Berger , Christian Brauner , Mimi Zohar Subject: [PATCH 4.9 02/34] ima: Remove ima_policy file before directory Date: Mon, 14 Feb 2022 10:25:28 +0100 Message-Id: <20220214092446.025737875@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092445.946718557@linuxfoundation.org> References: <20220214092445.946718557@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Berger 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 Cc: Acked-by: Christian Brauner Signed-off-by: Mimi Zohar Signed-off-by: Greg Kroah-Hartman --- security/integrity/ima/ima_fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c @@ -477,11 +477,11 @@ int __init ima_fs_init(void) return 0; out: + securityfs_remove(ima_policy); securityfs_remove(violations); securityfs_remove(runtime_measurements_count); securityfs_remove(ascii_runtime_measurements); securityfs_remove(binary_runtime_measurements); securityfs_remove(ima_dir); - securityfs_remove(ima_policy); return -1; }