Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5781241pxb; Mon, 14 Feb 2022 07:29:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUgAn1NttC2W8yfpiCzVJe/1XtZPZ6K6Bj9g49LYtUxx1nYNQ80Bo4tdKj1HkH+v3WL0GV X-Received: by 2002:aa7:cb87:: with SMTP id r7mr126748edt.284.1644852580130; Mon, 14 Feb 2022 07:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644852580; cv=none; d=google.com; s=arc-20160816; b=jbL+VvVBn9zrsuvc1QoAEyY9s4nlvpGjBYIVV3teFWY6EgguRcNEH988zZjeKnMChx heHgTSYP+h97lcb5PjAqIbuNNE/wbQCeQJbaJmDUcu2ULBnKbIrjpG7SLSRecgTRh+As DA227yu2RqoSl+n5mtzW2j9l3whdRbqd3kchqyOItY3wcm2FzO36PiME/5Mgn+fl6pI7 AeEElCKQRMw8ItD/mHbgM4A4x60bro8yb7G4XAPA/P18apkUPrFUVsGPpxXJP/MH67bL 3oVHncTKdI6n0VVsFPRv3yOwoDvg4ncectQ0TC+2ZZekTW0JCpXBupgo+qOzFgMoBfZt DLTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tHZKGrDKdgN4A/E7BwfCTotCOKYhuUKWpY5ehzO3iC4=; b=nZdu3noLfO6RUm/DmBvz/cqWZjwM8qSf4/dlU3NNpXRCohT8gctPwcbvmUpLgxhHTn QSE/mpxf6JYQLqMyUXurcYM8FyANYxf8siSIl7dUoK1W6r3KB+GvN18o0BOOgpCqVtME CuS49M50KN3088W5kwbri/B/ti58fdVGbYLG3lV9j9rHHhVn6aj9CUbafTKZNutjTJR+ jq08cvI5h2PmJDOBoLxcrPsX9hS95XhbehXX0o3ouFzbjZiRBftjeMFnZZuUC0PoNlFH hfKRsD5ftTB0EwjMu9wRQ7m53rbQ/xG7mWLM7YF0D01qKVurHwKToJ/kvZioj+pQtT7l Su0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="aqJXK3/n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o11si319610ejy.554.2022.02.14.07.29.15; Mon, 14 Feb 2022 07:29:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="aqJXK3/n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245751AbiBNJup (ORCPT + 99 others); Mon, 14 Feb 2022 04:50:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245635AbiBNJqD (ORCPT ); Mon, 14 Feb 2022 04:46:03 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A548717B3; Mon, 14 Feb 2022 01:39:15 -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 dfw.source.kernel.org (Postfix) with ESMTPS id C82236102D; Mon, 14 Feb 2022 09:39:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BC86C340E9; Mon, 14 Feb 2022 09:39:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831554; bh=4RIDEAq+c22nmmG4y8cxqHGvT85mUiWcK7yNYU3i7IM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aqJXK3/nkfETofJ1CeDtn3sUOWG+pdjyCrsnsoK9TWMgoufkPBpSHRI3W2krsc/Bl g6Y5cQ0mW/5JR+Wind0zlxFToW0usSLBoH6RUNcryzVJIcRIPjN/4wcIz6iRpwg4FX 0GzyRFbAv6ni8945ZoiRYdpcYyTQ41aNJ9YQgt5g= 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 5.10 002/116] ima: Remove ima_policy file before directory Date: Mon, 14 Feb 2022 10:25:01 +0100 Message-Id: <20220214092458.753440143@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092458.668376521@linuxfoundation.org> References: <20220214092458.668376521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 @@ -496,12 +496,12 @@ 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_symlink); securityfs_remove(ima_dir); - securityfs_remove(ima_policy); return -1; }