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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2393C433E0 for ; Thu, 18 Jun 2020 16:31:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C48D2083B for ; Thu, 18 Jun 2020 16:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592497898; bh=e+L09yTe0Hdqp/LIca6GpnEH+MlJS6GkzkQFEfrKhWw=; h=Subject:To:Cc:From:Date:List-ID:From; b=keyJ34gyIjbT4vaDnVgMXD4y9nw31Woytzh/iqSZ9hPxzeirFo/V03o+rh2KPJG4x MrzxhtnT4C/9y/70os3W1w/UyZjti9pTs97OMw8myKWp/8GyTXOhBtGzKLfwhtK+ld O5n9WqVotJ6SLkuBhfY5IvHxLJsK/BxHOfsHr7wg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727880AbgFRQbh (ORCPT ); Thu, 18 Jun 2020 12:31:37 -0400 Received: from wforward2-smtp.messagingengine.com ([64.147.123.31]:52001 "EHLO wforward2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726928AbgFRQbf (ORCPT ); Thu, 18 Jun 2020 12:31:35 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id 563C9395; Thu, 18 Jun 2020 12:31:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 18 Jun 2020 12:31:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=dunYNS ttOx0yoB7MsCa6vtksxj4SSPDzatIfl7WcG6w=; b=ozHnUy+ntxvRHf5J804FyI rjDfyBKbYz9PDrChH3ZJb8Iye/ii5W16sm0R7C6yIj/j0pjDHqVIsqMJmhF/q/VA AdaiOx2lwDvPmUc1TU/P2uA/RY952RrauEziEvfsqssGKUywgRP2j/qivskhNuyj ho6fHOT+Um7xPwtqIX/Dd/D/CimP4E05l18GXCsWSW93UJx4TwpwjzBQuT3VCSHE 3HGCcPQp3qBvNg7HHAWbbASdzLorjOJfUjAMi9rJgwZRPZ6Jnu0Uzhq6umB8XzZG ENCrdr36DXBUej1r/R+Xs/QXGuIdZZpGh+Ej7uJdVq8b/hHWeFgQKbRS20GN0Xzg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejgedguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertd dttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdho rhhgqeenucggtffrrghtthgvrhhnpeeiteevheeuvdfhtdfgvdeiieehheefleevveehje duteevueevledujeejgfetheenucfkphepkeefrdekiedrkeelrddutdejnecuvehluhhs thgvrhfuihiivgepieenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorg hhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 84CC53061CCB; Thu, 18 Jun 2020 12:31:33 -0400 (EDT) Subject: FAILED: patch "[PATCH] ima: Set again build_ima_appraise variable" failed to apply to 5.7-stable tree To: krzysztof.struczynski@huawei.com, roberto.sassu@huawei.com, zohar@linux.ibm.com Cc: From: Date: Thu, 18 Jun 2020 18:31:19 +0200 Message-ID: <15924978792949@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.7-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From b59fda449cf07f2db3be3a67142e6c000f5e8d79 Mon Sep 17 00:00:00 2001 From: Krzysztof Struczynski Date: Mon, 27 Apr 2020 12:28:59 +0200 Subject: [PATCH] ima: Set again build_ima_appraise variable After adding the new add_rule() function in commit c52657d93b05 ("ima: refactor ima_init_policy()"), all appraisal flags are added to the temp_ima_appraise variable. Revert to the previous behavior instead of removing build_ima_appraise, to benefit from the protection offered by __ro_after_init. The mentioned commit introduced a bug, as it makes all the flags modifiable, while build_ima_appraise flags can be protected with __ro_after_init. Cc: stable@vger.kernel.org # 5.0.x Fixes: c52657d93b05 ("ima: refactor ima_init_policy()") Co-developed-by: Roberto Sassu Signed-off-by: Roberto Sassu Signed-off-by: Krzysztof Struczynski Signed-off-by: Mimi Zohar diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index ea9b991f0232..ef7f68cc935e 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -643,8 +643,14 @@ static void add_rules(struct ima_rule_entry *entries, int count, list_add_tail(&entry->list, &ima_policy_rules); } - if (entries[i].action == APPRAISE) - temp_ima_appraise |= ima_appraise_flag(entries[i].func); + if (entries[i].action == APPRAISE) { + if (entries != build_appraise_rules) + temp_ima_appraise |= + ima_appraise_flag(entries[i].func); + else + build_ima_appraise |= + ima_appraise_flag(entries[i].func); + } } }