linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Roberto Sassu <roberto.sassu@huawei.com>
Cc: linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, krzysztof.struczynski@huawei.com,
	silviu.vlasceanu@huawei.com
Subject: Re: [PATCH 5/5] ima: Remove unused build_ima_appraise variable
Date: Wed, 22 Apr 2020 18:59:44 -0400	[thread overview]
Message-ID: <1587596384.5165.31.camel@linux.ibm.com> (raw)
In-Reply-To: <20200325161455.7610-2-roberto.sassu@huawei.com>

Hi Roberto, Krzysztof,

On Wed, 2020-03-25 at 17:14 +0100, Roberto Sassu wrote:
> From: Krzysztof Struczynski <krzysztof.struczynski@huawei.com>
> 
> 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. Remove build_ima_appraise that is not set
> anymore.
> 
> Signed-off-by: Krzysztof Struczynski <krzysztof.struczynski@huawei.com>
> ---
>  security/integrity/ima/ima_policy.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
> index ea9b991f0232..fcc26bddd7fc 100644
> --- a/security/integrity/ima/ima_policy.c
> +++ b/security/integrity/ima/ima_policy.c
> @@ -48,7 +48,6 @@
>  
>  int ima_policy_flag;
>  static int temp_ima_appraise;
> -static int build_ima_appraise __ro_after_init;
>  
>  #define MAX_LSM_RULES 6
>  enum lsm_rule_types { LSM_OBJ_USER, LSM_OBJ_ROLE, LSM_OBJ_TYPE,
> @@ -606,7 +605,7 @@ void ima_update_policy_flag(void)
>  			ima_policy_flag |= entry->action;
>  	}
>  
> -	ima_appraise |= (build_ima_appraise | temp_ima_appraise);
> +	ima_appraise |= temp_ima_appraise;

You're correct that build_ima_appraise isn't being used any longer,
but ima_appraise isn't defined as __ro_after_init.  Instead of
removing build_ima_appraise, does it make sense to set it?

Mimi

>  	if (!ima_appraise)
>  		ima_policy_flag &= ~IMA_APPRAISE;
>  }


  reply	other threads:[~2020-04-22 22:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 16:11 [PATCH 1/5] ima: Set file->f_mode instead of file->f_flags in ima_calc_file_hash() Roberto Sassu
2020-03-25 16:11 ` [PATCH 2/5] evm: Check also if *tfm is an error pointer in init_desc() Roberto Sassu
2020-04-22 13:45   ` Mimi Zohar
2020-04-22 15:37     ` Roberto Sassu
2020-03-25 16:11 ` [PATCH 3/5] ima: Fix ima digest hash table key calculation Roberto Sassu
2020-04-22 20:56   ` Mimi Zohar
2020-04-23 10:21     ` Roberto Sassu
2020-04-23 16:53       ` Mimi Zohar
2020-04-24 12:18         ` Roberto Sassu
2020-04-24 14:45           ` Mimi Zohar
2020-03-25 16:14 ` [PATCH 4/5] ima: Remove redundant policy rule set in add_rules() Roberto Sassu
2020-03-25 16:14   ` [PATCH 5/5] ima: Remove unused build_ima_appraise variable Roberto Sassu
2020-04-22 22:59     ` Mimi Zohar [this message]
2020-04-22 12:03 ` [PATCH 1/5] ima: Set file->f_mode instead of file->f_flags in ima_calc_file_hash() Mimi Zohar
2020-04-22 15:39   ` Roberto Sassu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1587596384.5165.31.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=krzysztof.struczynski@huawei.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=roberto.sassu@huawei.com \
    --cc=silviu.vlasceanu@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).